Skip to content

test_unittest failure triggered by test_import + test_importlib #108927

Description

@Yhg1s

Bug report

Bug description:

test_unittest fails if (and only if) test_import and test_importlib are run (in the same process) before it:

./python -m test test_import test_importlib test_unittest
0:00:00 load avg: 3.83 Run tests sequentially
0:00:00 load avg: 3.83 [1/3] test_import
0:00:02 load avg: 3.52 [2/3] test_importlib
0:00:06 load avg: 3.24 [3/3] test_unittest
test test_unittest failed -- Traceback (most recent call last):
  File "/home/thomas/python/python/cpython/Lib/test/test_unittest/test_discovery.py", line 840, in test_discovery_failed_discovery
    with test.test_importlib.util.uncache('package'):
         ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'test.test_importlib' has no attribute 'util'

test_unittest failed (1 error)

CPython versions tested on:

3.12, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests 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