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
test___all__ and test_support alter execution environment #69881
Comments
test___all__ and test_support alter execution environment. $ python3.5 -m test test___all__ test_support
[1/2] test___all__
[2/2] test_support
All 2 tests OK.
$ python3.6 -m test test___all__ test_support
[1/2] test___all__
Warning -- files was modified by test___all__
[2/2] test_support
Warning -- files was modified by test_support
2 tests altered the execution environment:
test___all__ test_support When running these test files separately, problem is only present for test___all__: $ python3.5 -m test test___all__
[1/1] test___all__
1 test OK.
$ python3.6 -m test test___all__
[1/1] test___all__
Warning -- files was modified by test___all__
1 test altered the execution environment:
test___all__
$ python3.5 -m test test_support
[1/1] test_support
1 test OK.
$ python3.6 -m test test_support
[1/1] test_support
1 test OK. |
test_support has this line: TESTDIRN = os.path.basename(tempfile.mkdtemp(dir='.')) Which is the culprit. The reason it gets so far as to import the module is due to the "fuzzy logic" check looking for __all__ |
This was introduced with revision f8fa7bc837a3. I guess I overlooked the new messages because I run the tests with -Wall, which is affected by bpo-18383. It seems a bad idea to create a temporary directory when you import the test_support module. I propose this patch to defer creation until the one test that uses it is run. As for your patch Silent Ghost, I’m not sure. It kind of side-steps the real issue by tweaking a heuristic. Maybe we should keep the heuristic as it is, because it is simpler. |
defer-TESTDIRN.patch LGTM. |
New changeset fb72d6d7703c by Martin Panter in branch 'default': |
This should be fixed now. Thanks for the report Arfrever and the analysis Ghost. I still get these warnings, but they are discussed in bpo-18383: Warning -- warnings.filters was modified by test___all__ |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: