Skip to content

test_coverage_ignore in test_trace fails if setuptools is installed #129269

@colesbury

Description

@colesbury

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

Linked PRs

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