-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixture applied more than once - when running multiple tests #126
Comments
Thanks very much for reporting ! I'll have a look |
This is related to the way I handle cases requiring fixtures as of today: I create one fixture for each such case, and I register this fixture in the collection host (module, class) of the test function/fixture parametrized with the cases. This was not entirely bullet proof as you discovered: I was not properly creating a copy (hence the error message you receive, saying that the case function that was already turned into a fixture, is once again turned into a fixture). This requires some major refactoring to handle all 4 situations (case in module/class, test in module/class) and because in python it is quite difficult to detect the actual host (class or module) of a function ; but I made progress today. I'll keep you posted. |
…me function` when two functions parametrized with the same cases were sitting in the same file. Fixed #126
This was a hard one :) It seems to be fixed in 2.2.0 |
It seems I can only use my set of cases with a fixture for one test or else I get the following error
"fixture is being applied more than once to the same function" E ValueError: fixture is being applied more than once to the same function
Here is code that reproduces:
If I remove the second test, it works fine. Also, if I make the cases not depend on a fixture, it works fine.
It seems like it's including the fixture too many times when the decorator is used more than once.
The text was updated successfully, but these errors were encountered: