Skip to content

Crashes with KeyError: 'retried' when test is retried with pytest-retry #815

@angelos-p

Description

@angelos-p

It looks like the html reporter does not handle tests with the outcome retried.

It's quite easy to reproduce:

  1. Create a failing test with the mark @pytest.mark.flaky(retries=3, delay=1)
  2. Run the test and wait for it to fail so that it is retried
  3. Pytest crashes with:
File "/__w/xi/xi/tests/venv/lib/python3.9/site-packages/pytest_html/report_data.py", line 94, in outcomes
  self._outcomes[outcome.lower()]["value"] += 1
KeyError: 'retried'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions