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_unittest failure in leaks searching mode #69932
Comments
$ ./python -m test.regrtest -uall -R 3:3 test_unittest
[1/1] test_unittest
test test_unittest failed -- multiple errors occurred; run in verbose mode for details
1 test failed:
test_unittest
$ ./python -m test.regrtest -vvuall -R 3:3 test_unittest
... ====================================================================== Traceback (most recent call last):
File "/home/serhiy/py/cpython-debug/Lib/unittest/test/test_discovery.py", line 532, in test_discover_with_init_module_that_raises_SkipTest_on_import
pickle.loads(pickle.dumps(suite, proto))
_pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleSkipped'>: attribute lookup ModuleSkipped on unittest.loader failed ====================================================================== Traceback (most recent call last):
File "/home/serhiy/py/cpython-debug/Lib/unittest/test/test_discovery.py", line 508, in test_discover_with_module_that_raises_SkipTest_on_import
pickle.loads(pickle.dumps(suite, proto))
_pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleSkipped'>: attribute lookup ModuleSkipped on unittest.loader failed |
While checking that I didn't introduce a reference leak recently with my changes around _PyObject_FastCall(), I found the same issue: test_unittest doesn't work with regrtest -R. I get the same error: $ ./python -m test -R 0:1 -v test_unittest ====================================================================== Traceback (most recent call last):
File "/home/haypo/prog/python/default/Lib/unittest/test/test_discovery.py", line 572, in test_discover_with_init_module_that_raises_SkipTest_on_import
pickle.loads(pickle.dumps(suite, proto))
_pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleSkipped'>: attribute lookup ModuleSkipped on unittest.loader failed ====================================================================== Traceback (most recent call last):
File "/home/haypo/prog/python/default/Lib/unittest/test/test_discovery.py", line 548, in test_discover_with_module_that_raises_SkipTest_on_import
pickle.loads(pickle.dumps(suite, proto))
_pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleSkipped'>: attribute lookup ModuleSkipped on unittest.loader failed |
Simple reproduction: >>> pickle.dumps(unittest.loader._make_skipped_test('hello', RuntimeError, unittest.suite.TestSuite))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleSkipped'>: attribute lookup ModuleSkipped on unittest.loader failed Exporting ModuleSkipped in unittest.loader can solve this. But maybe any more elegant method? |
Fixed in duplicate bpo-30813. |
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: