(self)
| 2182 | stats=len(tests), parallel=True) |
| 2183 | |
| 2184 | def test_unload_tests(self): |
| 2185 | # Test that unloading test modules does not break tests |
| 2186 | # that import from other tests. |
| 2187 | # The test execution order matters for this test. |
| 2188 | # Both test_regrtest_a and test_regrtest_c which are executed before |
| 2189 | # and after test_regrtest_b import a submodule from the test_regrtest_b |
| 2190 | # package and use it in testing. test_regrtest_b itself does not import |
| 2191 | # that submodule. |
| 2192 | # Previously test_regrtest_c failed because test_regrtest_b.util in |
| 2193 | # sys.modules was left after test_regrtest_a (making the import |
| 2194 | # statement no-op), but new test_regrtest_b without the util attribute |
| 2195 | # was imported for test_regrtest_b. |
| 2196 | testdir = os.path.join(os.path.dirname(__file__), |
| 2197 | 'regrtestdata', 'import_from_tests') |
| 2198 | tests = [f'test_regrtest_{name}' for name in ('a', 'b', 'c')] |
| 2199 | args = ['-Wd', '-E', '-bb', '-m', 'test', '--testdir=%s' % testdir, *tests] |
| 2200 | output = self.run_python(args) |
| 2201 | self.check_executed_tests(output, tests, stats=3) |
| 2202 | |
| 2203 | def check_add_python_opts(self, option): |
| 2204 | # --fast-ci and --slow-ci add "-u -W default -bb -E" options to Python |
nothing calls this directly
no test coverage detected