Replies: 2 comments 3 replies
-
It's possible to use indirect parametrization to make pytest aware, however its expected behavior not to tear down there |
Beta Was this translation helpful? Give feedback.
0 replies
-
I came up against a very similar problem, see my discussion topic here: #11038 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I really like working with pytest, but I have encountered a certain problem I would like to ask for an advice on.
I have a test module with the following structure:
So I have a problem with how fixtures are set up/torn down for TestClass2:
I would like for arrange_basic() to be torn down between sets of parametrized tests along with arrange_more(), but I don't know what way is the most efficient design-wise.
The only solution I have now is to have a copy of arrange_basic inside of TestClass2 where it has test parameter as an argument:
This way it gets torn down between running sets of tests, but I don't like that I have to duplicate code. I found a similar topic #9458 but it seems that the conclusion was the same as what I came up with.
Beta Was this translation helpful? Give feedback.
All reactions