FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-89392: Remove support of test_main() in libregrtest by serhiy-storchaka · Pull Request #108876 · python/cpython · GitHub

/ cpython Public

gh-89392: Remove support of test_main() in libregrtest - #108876

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:regretest-no-test_main
Sep 5, 2023
Merged

gh-89392: Remove support of test_main() in libregrtest#108876
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:regretest-no-test_main

Conversation

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

Copy link
Copy Markdown
Member

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread Lib/test/libregrtest/runtest.py Outdated
serhiy-storchaka merged commit 04a0830 into python:main 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.
🐍🍒⛏🤖

serhiy-storchaka deleted the regretest-no-test_main branch September 5, 2023 05:36

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.

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

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

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 5, 2023
…ythonGH-108876).

(cherry picked from commit 04a0830)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

Copy link
Copy Markdown

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

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
…ythonGH-108876).

(cherry picked from commit 04a0830)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

Copy link
Copy Markdown

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

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
Yhg1s pushed a commit that referenced this pull request Sep 5, 2023
) (#108897)

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

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL