-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-36160: Fix test_site so that it can run independently of other tests #12131
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
Conversation
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.
Hi @native-api, thanks for the patch but it looks like it has been fixed in another PR:
./python -m test.test_site
................s.s.........ss
----------------------------------------------------------------------
Ran 30 tests in 0.581s
OK (skipped=4)
I think we can close this one.
@remilapeyre I still see the reported error in branches |
Sorry, it was a mistake :/ |
Lib/test/test_site.py
Outdated
@@ -49,6 +49,8 @@ def setUpModule(): | |||
raise unittest.SkipTest('unable to create user site directory (%r): %s' | |||
% (site.USER_SITE, exc)) | |||
|
|||
# sysconfig._CONFIG_VARS is None until the first call to this function | |||
sysconfig.get_config_vars() |
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.
I think it would be better to guard the sysconfig._CONFIG_VARS.clear()
call in tearDown rather than add an unnecessary initialization.
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.
Sounds good. Accessing sysconfig._CONFIG_VARS
directly is an unsupported operation -- so it's the job of whoever does it to make sure that it works in all cases.
Accessing _CONFIG_VARS directly is unsupported so it's the job of whoever does that to ensure that it works in all cases
Thanks @native-api for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9. |
…sts (pythonGH-12131) (cherry picked from commit 1270ad6) Co-authored-by: native-api <[email protected]>
GH-26262 is a backport of this pull request to the 3.10 branch. |
…sts (pythonGH-12131) (cherry picked from commit 1270ad6) Co-authored-by: native-api <[email protected]>
GH-26263 is a backport of this pull request to the 3.9 branch. |
…sts (GH-12131) (GH-26263) (cherry picked from commit 1270ad6) Co-authored-by: native-api <[email protected]>
…sts (GH-12131) (GH-26262) (cherry picked from commit 1270ad6) Co-authored-by: native-api <[email protected]>
https://bugs.python.org/issue36160