Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_coverage_ignore in test_trace fails if setuptools is installed #129269

Open
colesbury opened this issue Jan 24, 2025 · 0 comments
Open

test_coverage_ignore in test_trace fails if setuptools is installed #129269

colesbury opened this issue Jan 24, 2025 · 0 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@colesbury
Copy link
Contributor

colesbury commented Jan 24, 2025

Bug report

Bug description:

The test_coverage_ignore test fails if setuptools is installed:

======================================================================
FAIL: test_coverage_ignore (test.test_trace.TestCoverage.test_coverage_ignore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/raid/sgross/cpython/Lib/test/test_trace.py", line 398, in test_coverage_ignore
    self.assertEqual(files, ['_importlib.cover'])  # Ignore __import__
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Lists differ: ['_distutils_hack.__init__.cover', 're.__ini[36 chars]ver'] != ['_importlib.cover']

First differing element 0:
'_distutils_hack.__init__.cover'
'_importlib.cover'

First list contains 2 additional elements.
First extra element 1:
're.__init__.cover'

+ ['_importlib.cover']
- ['_distutils_hack.__init__.cover',
-  're.__init__.cover',
-  'collections.__init__.cover']

----------------------------------------------------------------------

You can see this with an installed Python:

python3 -m test test_trace -v

Or from the cpython build without installing CPython:

...
make -j
./python -m ensurepip
./python -m pip install setuptools
./python -m test test_trace -v

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

@colesbury colesbury added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant