Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Running test_dataclasses file directly fails #104015

Closed
Assignees
sobolevn
Labels
3.12only security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error
@wookie184

Description

@wookie184

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

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp