GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-89392: Remove support of test_main() in libregrtest by serhiy-storchaka · Pull Request #108876 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 4, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Always use unittest for collecting tests in regrtests #89392

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
pythongh-89392: Remove support of test_main() in libregrtest
59b2995
@serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 4, 2023
@serhiy-storchaka
serhiy-storchaka requested a review from vstinner September 4, 2023 12:22
@bedevere-bot bedevere-bot added the awaiting core review label Sep 4, 2023
@bedevere-bot bedevere-bot mentioned this pull request Sep 4, 2023
Always use unittest for collecting tests in regrtests #89392
Closed
vstinner
vstinner approved these changes Sep 4, 2023
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I would prefer a better error message if a test module has a test_main() function.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/libregrtest/runtest.py Outdated
else:
def test_func():
return run_unittest(test_mod)
assert not hasattr(test_mod, "test_main")

@vstinner vstinner Sep 4, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please replace the assert with a regular exception. Like:

if hasattr(test_mod, "test_main"):
    raise Exception("Module {result.test_name} defines test_main() which is no longer supported by regrtest")

Maybe add a comment linking to https://github.com/python/cpython/issues/89392.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Sep 4, 2023
serhiy-storchaka
serhiy-storchaka commented Sep 5, 2023
View reviewed changes
Comment thread Lib/test/libregrtest/runtest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
Update Lib/test/libregrtest/runtest.py
8e2ef4e
@serhiy-storchaka
serhiy-storchaka merged commit 04a0830 into python:main Sep 5, 2023
@miss-islington

miss-islington commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting core review and removed awaiting merge labels Sep 5, 2023
@serhiy-storchaka
serhiy-storchaka deleted the regretest-no-test_main branch September 5, 2023 05:36
@bedevere-bot

bedevere-bot commented Sep 5, 2023

Copy link
Copy Markdown

There's a new commit after the PR has been approved.

@vstinner: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot
bedevere-bot requested a review from vstinner September 5, 2023 05:36
@miss-islington

miss-islington commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 04a0830b00879efe057e3dfe75e9aa9c0caf1a26 3.12

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned serhiy-storchaka Sep 5, 2023
@miss-islington

miss-islington commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 04a0830b00879efe057e3dfe75e9aa9c0caf1a26 3.11

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 5, 2023
@serhiy-storchaka
[3.12] pythongh-89392: Remove support of test_main() in libregrtest (p…
06901ab
…ythonGH-108876).

(cherry picked from commit 04a0830)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot

bedevere-bot commented Sep 5, 2023

Copy link
Copy Markdown

GH-108897 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Sep 5, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 5, 2023
@serhiy-storchaka
[3.11] pythongh-89392: Remove support of test_main() in libregrtest (p…
d215892
…ythonGH-108876).

(cherry picked from commit 04a0830)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot

bedevere-bot commented Sep 5, 2023

Copy link
Copy Markdown

GH-108898 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Sep 5, 2023
serhiy-storchaka added a commit that referenced this pull request Sep 5, 2023
@serhiy-storchaka
[3.11] gh-89392: Remove support of test_main() in libregrtest (GH-108876
492e1ff
) (GH-108898)

(cherry picked from commit 04a0830)
Yhg1s pushed a commit that referenced this pull request Sep 5, 2023
@serhiy-storchaka @AlexWaygood
[3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876
5121faa
) (#108897)

[3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876).
(cherry picked from commit 04a0830)

Co-authored-by: Alex Waygood <[email protected]>
@serhiy-storchaka serhiy-storchaka mentioned this pull request Sep 5, 2023
Add missed "f" in an f-string #108906
Merged
@serhiy-storchaka serhiy-storchaka removed their assignment Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner Awaiting requested review from vstinner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@serhiy-storchaka @miss-islington @bedevere-bot @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.