-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
testEnviron (test.test_wsgiref.HandlerTests) fails when environment variable X is set #81592
Comments
In Fedora CI, we use the environment variable X to set tests to skip: https://src.fedoraproject.org/tests/python/blob/bd3ec9505cd37d80fe47fbb8234928abcfc0c658/f/selftest/parallel.sh#_9 - lines 9 and 21 However, I'Ve realized that testEnviron (test.test_wsgiref.HandlerTests) fails. Here's a reproducer: $ python3.7 -m test test_wsgiref
Run tests sequentially
0:00:00 load avg: 0.75 [1/1] test_wsgiref == Tests result: SUCCESS == 1 test OK. Total duration: 77 ms $ X=boom python3.7 -m test test_wsgiref
Run tests sequentially
0:00:00 load avg: 0.71 [1/1] test_wsgiref
test test_wsgiref failed -- Traceback (most recent call last):
File "/usr/lib64/python3.7/test/test_wsgiref.py", line 567, in testEnviron
self.checkOSEnviron(h)
File "/usr/lib64/python3.7/test/test_wsgiref.py", line 559, in checkOSEnviron
self.assertEqual(env[k],v)
AssertionError: 'Y' != 'boom'
- Y
+ boom test_wsgiref failed == Tests result: FAILURE == 1 test failed: Total duration: 73 ms I believe that such tests should not be so easily fooled - it should be properly isolated or a less common variable name should be used if that is not possible, such as PYTHON_TEST_WSGIREF_TMP instead of X. |
I wrote PR 14394 to fix the test. |
Ok, the bug is now fixed in 2.7, 3.7, 3.8 and master branches. Thanks Miro for the report. I also enhanced the test to test all variables of handler.environ. |
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: