-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-116303: Skip test module dependent tests if test modules are unavailable #117341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-116303: Skip test module dependent tests if test modules are unavailable #117341
Conversation
Lib/test/support/__init__.py
Outdated
@@ -1168,6 +1168,16 @@ def requires_limited_api(test): | |||
return unittest.skip('needs _testcapi and _testlimitedcapi modules')(test) | |||
return test | |||
|
|||
|
|||
TEST_MODULES = sysconfig.get_config_var('TEST_MODULES') |
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.
Perhaps name this TEST_MODULES_ENABLED
and make it a boolean.
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.
That sounds like a good idea.
Also, IMO if TEST_MODULES
has an unknown value the tests should not be skipped -- they should fail.
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.
Also, IMO if
TEST_MODULES
has an unknown value the tests should not be skipped -- they should fail.
Well, you might as well make the whole test suite fail in that case; if TEST_MODULES
has an unknown value, something is more than a little bit off.
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.
Thank you for combing through these!
Lib/test/test_call.py
Outdated
(1, 2), {}, (expected_self, (1, 2), NULL_OR_EMPTY)), | ||
]) | ||
@classmethod | ||
def setUpClass(cls): |
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.
Either do these in the class body, or revert the additions in tearDownClass
.
Otherwise, they accumulate in repeated runs (like -R:
).
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.
... or just require test modules for this test case; IMO we should not add too much complexity in order to make the test suite pass when test modules are unavailable.
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.
Well, it's not too bad to do it in the class body. See 7efd0ce.
Lib/test/support/__init__.py
Outdated
@@ -1168,6 +1168,16 @@ def requires_limited_api(test): | |||
return unittest.skip('needs _testcapi and _testlimitedcapi modules')(test) | |||
return test | |||
|
|||
|
|||
TEST_MODULES = sysconfig.get_config_var('TEST_MODULES') |
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.
That sounds like a good idea.
Also, IMO if TEST_MODULES
has an unknown value the tests should not be skipped -- they should fail.
Draft PR: |
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.
This comment was marked as outdated.
This comment was marked as outdated.
Thanks for the reviews, everyone. |
Based off of #116307.
--disable-test-modules
is supplied #116303