Skip to content

Replace @flaky.flaky decorate with pytest marker#2229

Merged
Carreau merged 1 commit intojupyter:mainfrom
mgorny:flaky-mark
Oct 16, 2025
Merged

Replace @flaky.flaky decorate with pytest marker#2229
Carreau merged 1 commit intojupyter:mainfrom
mgorny:flaky-mark

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Jul 24, 2025

Use the @pytest.mark.flaky marker in place of the @flaky.flaky decorator, to modernize the code and improve compatibility with other plugins providing the feature such as pytest-rerunfailures.

Use the `@pytest.mark.flaky` marker in place of the `@flaky.flaky`
decorator, to modernize the code and improve compatibility with other
plugins providing the feature such as `pytest-rerunfailures`.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
@Carreau
Copy link
Member

Carreau commented Oct 16, 2025

Sounds great; Thanks for this, I'm going to merge, it would be good if you can link to some docs listing the advantage of this and pytest-rerunfailures vs using flaky directly.

@Carreau Carreau merged commit d0d1cb6 into jupyter:main Oct 16, 2025
23 of 24 checks passed
@mgorny mgorny deleted the flaky-mark branch October 16, 2025 17:09
@mgorny
Copy link
Contributor Author

mgorny commented Oct 16, 2025

Sounds great; Thanks for this, I'm going to merge, it would be good if you can link to some docs listing the advantage of this and pytest-rerunfailures vs using flaky directly.

I'm afraid I don't know of anything specific. The rough idea is that if you import flaky, then you must use flaky, but if you use the marker you can use any plugin that implements that marker — so probably the most relevant docs are the docs of different plugins implementing the marker.

As for why pytest-rerunfailures, it's pretty arbitrary. It's just that we've happened to hit packages that requires pytest-rerunfailures specifically and failed when flaky was enabled (sorry, don't recall which exactly), but worked the other way around.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants