Complete state isolation between tests #12819
-
I know this question has been asked in similar forms many times before, but I was not able to find a solution to my exact problem, so please bear with me. I'm trying to write tests for batchframe, which is a CLI tool that dynamically loads python modules based on user input, and it's causing issues in e2e tests where I want to simulate the full execution flow. Let's assume I have two tests, where I point the tool to load two different modules from the project's The problem comes from my usage of the My question is, what would be the best way to go about testing such a CLI tool end-to-end? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
If the tool is implemented in a test hostile way, use subprocess, unless state can be fixed for the tool you stand no chance |
Beta Was this translation helpful? Give feedback.
-
I'm sorry for the late follow-up, but does pytest have some facets/plugins to support this case? Perhaps you could point me to a project that has the same problem as mine? |
Beta Was this translation helpful? Give feedback.
-
Alright. I'll close this issue then |
Beta Was this translation helpful? Give feedback.
If the tool is implemented in a test hostile way, use subprocess, unless state can be fixed for the tool you stand no chance