[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", line 3802, in test_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", line 3802, in test_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", line 3802, in test_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", line 3802, in test_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", line 3802, in test_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", line 3802, in test_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.408s
FAILED (errors=6)
I'm not sure what the cause of the failure is.
Bug report
Running
./python Lib/test/test_dataclasses.pygives me these test fails:When running
./python -m test test_dataclasses, the tests all pass successfully. My understanding is thatpython -m testis 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
Linked PRs
test_dataclasses#104017