test_rerun integration tests fail with pytest-rerunfailures 16.7
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in basereport.py at pytest_runtest_logreport and follow how stored reports are accumulated and when the report is treated as finished; the issue says these are processed without being cleared at the first non-rerun teardown. Reproduce with testing/test_integration.py::TestHTML::test_rerun and TestLogCapturing::test_rerun under pytest-rerunfailures 16.7, then confirm the rerun count reads 2 rather than 5 after the teardown-per-attempt sequence.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 779
- Forks
- 261
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytest-dev/pytest-html
-
HTML extras for 'call' and 'teardown' phases get mergedPossibly taken @contputer0x0 claimed this 21 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
pytest-dev/pytest-html#1077 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
pytest-dev/pytest-html#1039 ·
-
Feature: pluggable HTML themes via Jinja2 template inheritancePossibly taken @RonnyPfannschmidt claimed this 161 days ago. Open
pytest-dev/pytest-html#1029 · 1 reaction · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
pytest-dev/pytest-html#1027 ·
-
pytest-html does not escape HTML in testId (v4.2.0)Possibly taken @golikovichev claimed this 145 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
pytest-dev/pytest-html#1024 ·
All issues in pytest-dev/pytest-html
Similar issues
-
URLValidator ignores an explicit empty scheme allowlistPossibly taken @IlyaKhalafi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
tortoise/tortoise-orm#2393 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
frappe/frappe_docker#2046 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
AXI SMU SPEC
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
tenstorrent/tt-oca-harness#3556 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/agent-framework#9946 ·
Maintainers usually reply within 1 day