Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Running./python Lib/test/test_dataclasses.py gives me these test fails:
[root@codespaces-44977f cpython]# ./python Lib/test/test_dataclasses.py....................................................................................................................................................................................EEEEEE...................................................======================================================================ERROR:test_pickle_support (__main__.TestMakeDataclass.test_pickle_support) (proto=0)----------------------------------------------------------------------Traceback (most recent call last): File"/workspaces/cpython/Lib/test/test_dataclasses.py", line3802, intest_pickle_support pickle.loads(pickle.dumps(klass, proto)),^^^^^^^^^^^^^^^^^^^^^^^^^^_pickle.PicklingError:Can't pickle <class 'test.test_dataclasses.ManualModuleMakeDataClass'>: it's not the same object as test.test_dataclasses.ManualModuleMakeDataClass======================================================================ERROR:test_pickle_support (__main__.TestMakeDataclass.test_pickle_support) (proto=1)----------------------------------------------------------------------Traceback (most recent call last): File"/workspaces/cpython/Lib/test/test_dataclasses.py", line3802, intest_pickle_support pickle.loads(pickle.dumps(klass, proto)),^^^^^^^^^^^^^^^^^^^^^^^^^^_pickle.PicklingError:Can't pickle <class 'test.test_dataclasses.ManualModuleMakeDataClass'>: it's not the same object as test.test_dataclasses.ManualModuleMakeDataClass======================================================================ERROR:test_pickle_support (__main__.TestMakeDataclass.test_pickle_support) (proto=2)----------------------------------------------------------------------Traceback (most recent call last): File"/workspaces/cpython/Lib/test/test_dataclasses.py", line3802, intest_pickle_support pickle.loads(pickle.dumps(klass, proto)),^^^^^^^^^^^^^^^^^^^^^^^^^^_pickle.PicklingError:Can't pickle <class 'test.test_dataclasses.ManualModuleMakeDataClass'>: it's not the same object as test.test_dataclasses.ManualModuleMakeDataClass======================================================================ERROR:test_pickle_support (__main__.TestMakeDataclass.test_pickle_support) (proto=3)----------------------------------------------------------------------Traceback (most recent call last): File"/workspaces/cpython/Lib/test/test_dataclasses.py", line3802, intest_pickle_support pickle.loads(pickle.dumps(klass, proto)),^^^^^^^^^^^^^^^^^^^^^^^^^^_pickle.PicklingError:Can't pickle <class 'test.test_dataclasses.ManualModuleMakeDataClass'>: it's not the same object as test.test_dataclasses.ManualModuleMakeDataClass======================================================================ERROR:test_pickle_support (__main__.TestMakeDataclass.test_pickle_support) (proto=4)----------------------------------------------------------------------Traceback (most recent call last): File"/workspaces/cpython/Lib/test/test_dataclasses.py", line3802, intest_pickle_support pickle.loads(pickle.dumps(klass, proto)),^^^^^^^^^^^^^^^^^^^^^^^^^^_pickle.PicklingError:Can't pickle <class 'test.test_dataclasses.ManualModuleMakeDataClass'>: it's not the same object as test.test_dataclasses.ManualModuleMakeDataClass======================================================================ERROR:test_pickle_support (__main__.TestMakeDataclass.test_pickle_support) (proto=5)----------------------------------------------------------------------Traceback (most recent call last): File"/workspaces/cpython/Lib/test/test_dataclasses.py", line3802, intest_pickle_support pickle.loads(pickle.dumps(klass, proto)),^^^^^^^^^^^^^^^^^^^^^^^^^^_pickle.PicklingError:Can't pickle <class 'test.test_dataclasses.ManualModuleMakeDataClass'>: it's not the same object as test.test_dataclasses.ManualModuleMakeDataClass----------------------------------------------------------------------Ran 232 tests in 0.408sFAILED (errors=6)
When running./python -m test test_dataclasses, the tests all pass successfully. My understanding is thatpython -m test is the recommended way of running tests, but it's confusing to have it support running the file directly, but have the tests fail.
I'm not sure what the cause of the failure is.
Your environment
- CPython versions tested on: main (ed95e8c)
- Operating system and architecture: GitHub Codespaces