Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flaky is broken with pytest 8.1 #12072

Closed
qci-amos opened this issue Mar 4, 2024 · 4 comments
Closed

flaky is broken with pytest 8.1 #12072

qci-amos opened this issue Mar 4, 2024 · 4 comments

Comments

@qci-amos
Copy link

qci-amos commented Mar 4, 2024

  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "/home/travis/miniconda/envs/env/lib/python3.11/site-packages/_pytest/assertion/rewrite.py", line 178, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/miniconda/envs/flaqumen/lib/python3.11/site-packages/flaky/flaky_pytest_plugin.py", line 5, in <module>
    from _pytest.runner import call_runtest_hook  # pylint:disable=import-error
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'call_runtest_hook' from '_pytest.runner' (/home/travis/miniconda/envs/env/lib/python3.11/site-packages/_pytest/runner.py)

I'm not sure if this is a duplicate of #12069 (please feel free to close if so)

but I will note that flaky hasn't had a new release in almost 4 years:
https://github.com/box/flaky

@qci-amos qci-amos changed the title flaky is broken with pytest 8.1 flaky is broken with pytest 8.1 Mar 4, 2024
@RonnyPfannschmidt
Copy link
Member

indeed, closing as duplicate of #12069

@RonnyPfannschmidt RonnyPfannschmidt closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
@The-Compiler
Copy link
Member

#12069 seems unrelated, flaky is using private APIs which happen to break. It's a duplicate of #12066, however.

Already reported here: box/flaky#198

But given that flaky hasn't had a release since 2020 and hasn't had a commit for the past half year (with nobody seeming to care), you're probably better off to migrating to something that's actually maintained (e.g. pytest-rerunfailures).

@qci-amos
Copy link
Author

qci-amos commented Mar 4, 2024

Oops, I didn't check for issues that were already closed!

I didn't know that flaky was no longer recommended. I'll point out it's still the first on the list that appears here:
https://docs.pytest.org/en/stable/explanation/flaky.html

what do people think about updating that documentation?

@qci-amos
Copy link
Author

qci-amos commented Mar 4, 2024

I'll also note that I'm discovering that flaky and pytest-rerunfailures can't co-exist in the same python environment because they define the same mark but with different APIs.

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

No branches or pull requests

3 participants