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 failure introduced by the fix for issue #22462 #67084
Comments
the fix for issue bpo-22462 introduces a regression in the test_pyexpat test cases. I'm not yet sure why. This is only seen when running the testsuite from the installed location, which shouldn't matter. Tried to run the tests with a stripped executable in the build tree worked too, so I'm lost why this now fails. Confirmed that reverting the fix resolves running the testcase in the same environment. |
Please post the traceback. |
[258/383] test_pyexpat
test test_pyexpat failed -- Traceback (most recent call last):
File "/usr/lib/python3.4/test/test_pyexpat.py", line 432, in test_exception
parser.Parse(b"<a><b><c/></b></a>", 1)
File "../Modules/pyexpat.c", line 405, in StartElement
File "/usr/lib/python3.4/test/test_pyexpat.py", line 422, in StartElementHandler
raise RuntimeError(name)
RuntimeError: a
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/test/test_pyexpat.py", line 447, in test_exception
self.assertIn('call_with_frame("StartElement"', entries[1][3])
File "/usr/lib/python3.4/unittest/case.py", line 1053, in assertIn
if member not in container:
TypeError: argument of type 'NoneType' is not iterable test_exception (test.test_pyexpat.HandlerExceptionTest) ... ERROR ====================================================================== Traceback (most recent call last):
File "/usr/lib/python3.4/test/test_pyexpat.py", line 432, in test_exception
parser.Parse(b"<a><b><c/></b></a>", 1)
File "../Modules/pyexpat.c", line 405, in StartElement
File "/usr/lib/python3.4/test/test_pyexpat.py", line 422, in StartElementHandler
raise RuntimeError(name)
RuntimeError: a
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/test/test_pyexpat.py", line 447, in test_exception
self.assertIn('call_with_frame("StartElement"', entries[1][3])
File "/usr/lib/python3.4/unittest/case.py", line 1053, in assertIn
if member not in container:
TypeError: argument of type 'NoneType' is not iterable Ran 36 tests in 0.016s |
Thanks. So, this is not a regression: the failing test was introduced in bpo-22462 and probably would have not worked before, either. The problem is that "../Modules/pyexpat.c" makes sense from the checkout directory but not necessarily from the install location. I don't know if we should try to be smarter or not. At first we could make the test more lenient. |
do we have something like skipIfInstalled? |
No. There's no exact way of checking for an installed Python, but one possibility is to test whether a given directory exists (e.g. "Modules"). |
What about using “not sysconfig.is_python_build()”? |
I had forgotten about it, thank you. |
New changeset e4b986350feb by Antoine Pitrou in branch '3.4': New changeset 4990157343c6 by Antoine Pitrou in branch 'default': |
This should be fixed now. |
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: