Closed
Description
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
- gh-108927: Fix test_import + test_importlib + test_unittest problem #108929
- gh-108927: Fix removing testing modules from sys.modules #108952
- [3.12] gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929) #108954
- [3.11] gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929) #110347
- [3.12] gh-108927: Fix removing testing modules from sys.modules (GH-108952) #112711
- [3.11] gh-108927: Fix removing testing modules from sys.modules (GH-108952) #112712
- gh-108927: Include new dir test/regrtestdata in the installation #112765
- [3.11] gh-108927: Include new dir test/regrtestdata in the installati… #112784
- [3.12] gh-108927: Include new dir test/regrtestdata in the installati… #112785