Repository navigation
Replies: 1 comment
|
Hi @Stefanhg If
For example, mark the test: Then conditionally keep/order it: This gives you the desired behavior without manually constructing pytest internals:
If the testcase genuinely does not exist until runtime data is examined, then yes — create it through collection, using an appropriate collector/collection hook and Please mark this answer as accepted if it helped, thank you. |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I want to add a custom testcase to the
pytest_collection_modifyitemsitems list before my test session starts depending on a variable set in the pytestconfig.I played around with different functions and got stuck at this
from_parentfunction which I haven't had any success with.I do have a "work-around" which is just including it with
-kand give a warning if variable is set in config and the testcase is missing in collector but what's the fun in that!My goal is to:
Simplified example of what i want to do, it is kind of hard to show when you don't know how to implement.
I am unsure if it is even possible to do this way or it has to go though the collector.
All reactions