You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I want to add a custom testcase to the pytest_collection_modifyitems items list before my test session starts depending on a variable set in the pytest config.
I played around with different functions and got stuck at this from_parent function which I haven't had any success with.
I do have a "work-around" which is just including it with -k and 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:
Add the testcase to the testsuite,
To have it as the first testcase in the testsuite.
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I want to add a custom testcase to the
pytest_collection_modifyitems
items 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_parent
function which I haven't had any success with.I do have a "work-around" which is just including it with
-k
and 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.
Beta Was this translation helpful? Give feedback.
All reactions