Comments (4)
@ExplorerOL I think this is no longer a problem.
from pytest-rerunfailures.
In compatibilities I foud, that "This plugin may not be used with class, module, and package level fixtures"! I am really sad. I tried to modify code of plugin and managed to make it working with class-scoped fixture! My code may be not perfect and after reruns fixture with scope=class may called several times even in class, but in my case it is better than teardown is not called at all!
I modified a part of original code in the following way:
if item in item.session._setupstate.stack:
if PYTEST_GTE_63:
# original code
# for key in list(item.session._setupstate.stack.keys()):
# if key != item:
# del item.session._setupstate.stack[key]
# my code
keys_to_delete = list(item.session._setupstate.stack)[:-2]
for key in keys_to_delete:
if key != item:
del item.session._setupstate.stack[key]
else:
for node in list(item.session._setupstate.stack):
if node != item:
item.session._setupstate.stack.remove(node)
from pytest-rerunfailures.
I can confirm this issue having researched one of the falls in my project.
from pytest-rerunfailures.
@icemac Hello! As I understand the incompatibility "This plugin may not be used with class, module, and package level fixtures" is overcome now. Am I right?
from pytest-rerunfailures.
Related Issues (20)
- For "only_rerun" allow access exception attributes HOT 1
- Can you identify if a particular is a re-run or not? HOT 3
- ENH: New option to rerun failures with the exception/inclusion of a path HOT 2
- Session and class scope fixtures won't teardown when specifying only_rerun or rerun_except HOT 1
- Tests are terminating with internal error HOT 7
- ImportError: cannot import name ‘resultlog_key‘ from ‘_pytest.resultlog‘
- pytest_runtest_logreport does not report "teardown" when using pytest-rerunfailures HOT 4
- AttributeError: 'list' object has no attribute 'items' in `_pytest.runner.SetupState.setup` HOT 4
- AttributeError: 'str' object has no attribute 'reprcrash' while using pytest.mark.xfail HOT 4
- `pytest-rerunfailures` slows down `pytest-xdist` testing HOT 3
- pytest_handlecrashitem faults with NotImplementedError when using the loadgroup test distribution algorithm HOT 1
- [RFC] `--pdb`: Friendlier default (use warning and infer `--reruns 0`)
- [RFC] `--reruns-on-exitfirst`: set reruns with `--exitfirst` / `-x`
- unify various linters with Ruff HOT 1
- only_rerun with exception raised from fixture teardown reruns test but report previous runs as failure
- set reruns does not work HOT 5
- Tests fail against pytest >= 8.2 HOT 6
- Test class instance is not recreated when retrying tests
- 14.0: pytest 8.2.2 fails in 5 units HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-rerunfailures.