Skip to content

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Jul 21, 2025

Replace the direct use of flaky.flaky decorator with the equivalent pytest fixture. This is both more canonical, and has the additional advantage of being compatible with the more modern pytest-rerunfailures plugin, that can be used in place of flaky.

Fixes #2003

Replace the direct use of `flaky.flaky` decorator with the equivalent
pytest fixture.  This is both more canonical, and has the additional
advantage of being compatible with the more modern
`pytest-rerunfailures` plugin, that can be used in place of `flaky`.

Fixes nedbat#2003

Signed-off-by: Michał Górny <[email protected]>
@nedbat
Copy link
Owner

nedbat commented Jul 21, 2025

Thanks. We can remove it from the requirements.in file (https://github.com/nedbat/coveragepy/blob/master/requirements/pytest.in#L9) too. make upgrade should rebuild the .txt files.

@nedbat
Copy link
Owner

nedbat commented Jul 21, 2025

I can handle the requirements later if you want. But why can't I find docs for pytest.mark.flaky?

@mgorny
Copy link
Contributor Author

mgorny commented Jul 22, 2025

I think there's a slight misunderstand. pytest.mark.flaky is provided both by flaky and pytest-rerunfailures packages:

For a minimal change, I've left it at flaky. If you want, I can swap it for pytest-rerunfailures — it's a matter of replacing the dep and removign --no-flaky-report (pytest-rerunfailures doesn't do such a thing).

@nedbat
Copy link
Owner

nedbat commented Jul 22, 2025

You're right, I did misunderstand. OK, let's make this change and keep pushing forward.

@nedbat nedbat merged commit e3b7cb7 into nedbat:master Jul 22, 2025
46 checks passed
@mgorny mgorny deleted the flaky-fixture branch July 22, 2025 09:36
@mgorny
Copy link
Contributor Author

mgorny commented Jul 22, 2025

Thanks!

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.

Please consider improving support for pytest-rerunfailures (in place of flaky)

2 participants