Skip to content

Pytest test suite fails with Pytest 9.0.3 #14394

@ChaseKnowlden

Description

@ChaseKnowlden
  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

The test suite for Pytest fails with Pytest 9.0.3.

Version: pytest 9.0.3
OS: Linux From Scratch version r13.0-64-systemd

Output:

_____ test_timeout[True] _______

pytester = <Pytester PosixPath('/tmp/pytest-of-chase/pytest-0/test_timeout0')>, enabled = True

    @pytest.mark.keep_ci_var
    @pytest.mark.parametrize(
        "enabled",
        [
            pytest.param(
                True,
                marks=pytest.mark.skipif(
                    bool(os.environ.get("CI"))
                    and sys.platform == "linux"
                    and sys.version_info >= (3, 14),
                    reason="sometimes crashes on CI because of truncated outputs (#7022)",
                ),
            ),
            False,
        ],
    )
    def test_timeout(pytester: Pytester, enabled: bool) -> None:
        """Test option to dump tracebacks after a certain timeout.

        If faulthandler is disabled, no traceback will be dumped.
        """
        pytester.makepyfile(
            """
        import os, time
        def test_timeout():
            time.sleep(1 if "CI" in os.environ else 0.1)
        """
        )
        pytester.makeini(
            """
            [pytest]
            faulthandler_timeout = 0.01
            """
        )
        args = ["-p", "no:faulthandler"] if not enabled else []

        result = pytester.runpytest_subprocess(*args)
        tb_output = "most recent call first"
        if enabled:
>           result.stderr.fnmatch_lines([f"*{tb_output}*"])
E           Failed: remains unmatched: '*most recent call first*'

/sources/BLFS/pytest-9.0.3/testing/test_faulthandler.py:114: Failed

Pip list:

Package                 Version
----------------------- ------------
argcomplete             3.6.3
asciidoc                10.2.1
attrs                   25.4.0
charset-normalizer      3.4.4
Cython                  3.2.4
docutils                0.22.4
editables               0.5
elementpath             5.1.1
flit_core               3.12.0
hatch-fancy-pypi-readme 25.1.0
hatch-vcs               0.5.0
hatchling               1.28.0
hypothesis              6.152.1
idna                    3.11
iniconfig               2.3.0
Jinja2                  3.1.6
lxml                    6.0.4
MarkupSafe              3.0.3
meson                   1.11.0
mock                    5.2.0
packaging               26.0
pathspec                1.0.4
pip                     26.0.1
pluggy                  1.6.0
pwquality               1.4.5
Pygments                2.20.0
pytest                  9.0.3
requests                2.33.1
setuptools              82.0.1
setuptools-scm          9.2.2
sortedcontainers        2.4.0
trove-classifiers       2026.1.14.14
urllib3                 2.6.3
wheel                   0.46.3
xmlschema               4.3.1

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