Replies: 2 comments 2 replies
-
It sounds like you're looking for parametrized fixtures. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have tried that and failed, but perhaps that is my own inexperience. I think the issue might be that whatever parameter the fixture is using, the test methods needs to be running with the same parameter value. I suppose I could just give up on using fixtures, parameterise the methods and just call a function which returns a value based on the parameter. I'd rather do it the proper way if such a thing exists though. |
Beta Was this translation helpful? Give feedback.
2 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.
-
Hi I'm having a bit of trouble figuring out how to parameterise an entire test file, any help would be much appreciated.
I have a test*.py file containing:
I have several different functions that this function "my_func" could be. At the moment I'm duplicating my test file for each possible value of "my_func". Is it possible to parameterise this in pytest and just run with the one file?
Here is a simplified example of the current setup.
Cheers.
Beta Was this translation helpful? Give feedback.
All reactions