-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-108927: Fix removing testing modules from sys.modules #108952
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
Changes from 1 commit
339f260
e52be9b
68c014e
c1ad70c
3f25ab4
7673248
5df4c8b
eb7766b
0eae535
66437b5
8470b33
544c068
1e7ea34
56621ab
ba5597a
d025e22
1aae341
017f01d
5086405
b3ea8fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import unittest | ||
| import test_regrtest_b.util | ||
|
|
||
| class Test(unittest.TestCase): | ||
| def test(self): | ||
| test_regrtest_b.util |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import unittest | ||
|
|
||
| class Test(unittest.TestCase): | ||
| def test(self): | ||
| pass |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import unittest | ||
| import test_regrtest_b.util | ||
|
|
||
| class Test(unittest.TestCase): | ||
| def test(self): | ||
| test_regrtest_b.util |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1866,6 +1866,14 @@ def test_random_seed(self): | |
| def test_random_seed_workers(self): | ||
| self._check_random_seed(run_workers=True) | ||
|
|
||
| def test_import_from_tests(self): | ||
| testdir = os.path.join(os.path.dirname(__file__), | ||
| 'regrtestdata', 'import_from_tests') | ||
| tests = [f'test_regrtest_{name}' for name in ('a', 'b', 'c')] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind to add a comment to explain the purpose of these test? By reading the code, it's unclear to me. Explain that the test execution order matters for this test. Does the test fails if a regression is introduced? Maybe add a test_regrtest_d test checking if test_regrtest_a, test_regrtest_b and test_regrtest_c are not loaded?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| args = ['-Wd', '-E', '-bb', '-m', 'test', '--testdir=%s' % testdir, *tests] | ||
| output = self.run_python(args) | ||
| self.check_executed_tests(output, tests, stats=3) | ||
|
|
||
|
|
||
| class TestUtils(unittest.TestCase): | ||
| def test_format_duration(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.