Skip to content

test_rerun integration tests fail with pytest-rerunfailures 16.7 #1085

Open

Description

@nicozdeb

With pytest-rerunfailures 16.7, both rerun integration tests fail:

FAILED testing/test_integration.py::TestHTML::test_rerun - AssertionError: Expected <5 Reruns> to match pattern <2 Reruns>, but did not.
FAILED testing/test_integration.py::TestLogCapturing::test_rerun - AssertionError: Expected <5 Reruns> to match pattern <2 Reruns>, but did not.

The test uses @pytest.mark.flaky(reruns=2) but the report shows 5 reruns.
Same result with the app.js/style.css shipped in the 4.2.0 sdist, so it
is not related to the frontend build.

Bisected: it starts with pytest-rerunfailures 16.7, which now runs and
reports teardown after each failed attempt
(setup, call:rerun, teardown, setup, call:rerun, teardown, ...).

pytest_runtest_logreport in basereport.py treats the first non-rerun
teardown as "finished" and processes all stored reports without
clearing them, so reruns are processed again at each teardown:
1 + 2 + 2 = 5 "Rerun" rows (3 of them with 0 ms duration).

Environment: pytest-html 4.2.0, pytest 9.1.1, pytest-rerunfailures 16.7,
Python 3.14, Debian unstable, chromium + chromedriver.

Activity

  1. nicozdeb commented on Oct 30, 2026

    @nicozdeb
    Author

    Fix proposed in #1086: pytest-rerunfailures 16.7 reports a teardown after each rerun attempt, which pytest-html treated as the end of the test, so reruns were processed again (1 + 2 + 2 = 5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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