Skip to content

Keep pytest-html extras on their owning result rows - #1078

Open
contputer0x0 wants to merge 4 commits into
pytest-dev:masterfrom
contputer0x0:issue-1077-preserve-phase-attempts-20261011
Open

contputer0x0 wants to merge 4 commits into
pytest-dev:masterfrom
contputer0x0:issue-1077-preserve-phase-attempts-20261011

Conversation

@contputer0x0

@contputer0x0 contputer0x0 commented Oct 11, 2026 •

Copy link
Copy Markdown

Summary

When a test call passed but teardown failed, extras collected during setup, call, and teardown appeared on both result rows. This also affected setup/teardown failures and could mix assets across retries.

Each visible result row now keeps its own phase's extras. Extras from successful setup and teardown phases, whose rows are intentionally hidden, remain available on a visible row of the same test attempt. Attempt boundaries also keep rerun assets and captured teardown logs separate, and incomplete attempts are finalized before the report is written. Replayed deliveries of the same report object are processed only once; a genuinely separate failed teardown still produces an error row.

Verification

  • python -m pytest testing/test_unit.py testing/test_phase_attempts.py testing/test_integration.py testing/test_e2e.py -q: 124 passed with each of pytest-rerunfailures 15.1 and 16.7, including the Selenium-backed integration and end-to-end tests.
  • npm run unit: 27 passed.
  • npm run lint and npm run build: passed.
  • black --check and flake8 on the modified Python files: passed.
  • The original 40-case regression suite reproduced 22 failures on the unmodified base revision; four additional cases reproduced duplicate and missing result rows before the follow-up fix. All 46 regression cases pass with this change, covering both report modes, missing and additional teardown reports, reruns, replayed report identity, and attempt-specific logs and media content. Rerun tests assert every phase actually emitted by the installed rerun plugin is preserved, including an optional successful teardown on the earlier attempt.
  • The full pre-commit run currently fails on seven djlint findings in the unchanged src/pytest_html/resources/index.jinja2 template. The same seven findings were reproduced on the upstream base commit, before this change. All other configured hooks passed.

Fixes #1077.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML extras for 'call' and 'teardown' phases get merged

1 participant