Comments (12)
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
To be more precise and make sure i understand: collecting yield-based tests needs setupstate and when further items are collected, the state may be teared down and thus when the yield-tests actually run, the setupstate needs to be recreated a second time. Right?
Now i wonder: why can the setup state not be created a second time?
And if that cannot happen, could the machinery be rewritten to use pytest_generate_tests?
feel free to also point me to the repo and exact code you are talking about.
from pytest.
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
ronny, what's the status of this issue and can you provide an exact example of what shoudl be fixed here?
from pytest.
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):
im not sure what/how to fix, the problem is that yield tests need a setupstate in collection,
in the case of moint the generate a local wiki instance and prepare data
since the setupstate is removed when tests in a different hierachy run, the yielded closures break since the setup state changed
from pytest.
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
can you provide a minimal failing code example?
from pytest.
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):
finally had a good idea for a minimal case
from pytest.
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
I assume, yield/setupstate is not an issue anymore, given that moinmoin now uses a more modern version.
from pytest.
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):
its still an isse, moinmoin has a hack in place to work around
from pytest.
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):
basically it will stay an issue till we provide a different way to have partial failures without stopping the complete test
from pytest.
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
I am not sure if we should pursue any improvements to yield-based tests. In any case, i don't know what the actual idea here is for improving yield-based setup. Doing larger scale refactorings just for better yield support does not seem worthwhile to me. It might be acceptable if better comes out as a side effect and the refactoring is useful for other reasons.
If nothing happens on this issue for a couple of months i'd like to close it.
from pytest.
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):
i hit yet another proejct where this prevents pytest usage
the suggested solution is to drop collecting yield items, and make reporting prettier later
from pytest.
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):
addresses #16 - replace Generator with pytest_pyfunc_interpret_result
from pytest.
finally addressed in #1714
from pytest.
Related Issues (20)
- `pytest==8.3.1` collects tests from Python dependencies within `conda` environments (regression from `8.2.2`) HOT 16
- Extend pytest capabilities to support fastapi Depends-style fixtures HOT 1
- Docs: collection hooks listed under reporting hooks HOT 4
- pytest >=8.1.1 displays no diff for AssertionError with --import-mode=importlib HOT 2
- Weird collection stats when filtering from `pytest_collection_modifyitems` hook HOT 1
- Too tight a type constraint on ExceptionInfo.errisinstance HOT 3
- Cache: Crash on Windows when using pytest-xdist HOT 5
- It would be good to have fixtures with dinamically changed / different scopes HOT 2
- CLI flag for supporting env variables from .env file HOT 3
- Erroneous quotes in `tmp_path_retention_policy` example in docs
- Tests not collected if parametrized with `itertools` objects and imported in multiple files HOT 3
- Doctests in __main__ are ignored HOT 3
- [TODO] Upload JUnit reports to Codecov HOT 3
- No tests are run when PyTest encounters some error condition on some of them HOT 1
- Warn on test arguments with default values? HOT 1
- [8.1.x][8.3.x] `testpaths` not taken into account for initial conftests loading when set through configuration file? HOT 4
- Surprisingly, pytest doesn't collect warnings when importing the package for plugins HOT 4
- Support navigating exceptions chains in pdb
- short test summary and -vv
- --failed-first and --new-first don't play well together
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.