Skip to content

Coverage Fails due to fs call intercepts on 3.14Β #1245

@cjames23

Description

@cjames23

Describe the bug

In 3.14 with coverage pyfakefs intercepts file system calls leading to coverage throwing an error for NoSource. This is likely due to changes in coverage with 3.14 using sys.monitoring instead of sys.settrace() is what I have narrowed it down to.

How To Reproduce

Run unit tests that use pyfakefs with coverage[toml] with 3.14 using pytest 9.0.0 and when coverage tries to access the file system for branch coverage this will be triggered.

Example test failure in hatch https://github.com/pypa/hatch/actions/runs/19286882217/job/55149434317

Your environment
Please run the following in the environment where the problem happened and
paste the output.

python -c "import platform; print(platform.platform())"
python -c "import sys; print('Python', sys.version)"
python -c "from pyfakefs import __version__; print('pyfakefs', __version__)"
python -c "import pytest; print('pytest', pytest.__version__)"

See link to Github Workflow for Tests in hatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions