Replies: 3 comments 1 reply
-
its not clear what you are asking for but it seems like you should use a fixture for your targets or outline the use case enough to avoid the XY-problem |
Beta Was this translation helpful? Give feedback.
-
After some more digging in fixtures.py i found the class |
Beta Was this translation helpful? Give feedback.
-
More testing later, still not working as intended for my needs! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am working on fixing a bug in some internal tools we use to handle working with targets in test.
The tool itself interacts with different targets across multiple Python packages and helps user interact with the targets. The tool is a Pytest plugin that between each tests closes the target
Closing the targets works fine with
pytest_runtest_teardown
unless people use the targets in the teardown (which they do).I resolved my issue initially by closing my targets in the
pytest_runtest_setup
but this looks confusing when reading the output of a test so that's not acceptable.So my question is. How does PyTest "close"/exit fixtures and is there a more nicer way for me to do something after fixtures are closed?
I have been reading a bit in
_pytest/fixtures.py
but I could not find anything that could answer my questions.Beta Was this translation helpful? Give feedback.
All reactions