-
Notifications
You must be signed in to change notification settings - Fork 39
Fixtures defined in case files not found #193
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
Comments
THanks @marvinpfoertner ! From the documentation indeed it is a bot ambiguous. From what I remember, defining a fixture in a non test file does not work. I'll check this now to be sure there is no easy workaround |
@marvinpfoertner which version of |
@smarie Thanks for responding so quickly! I'm running version 3.2.1. But I also just noticed that I pasted the wrong code snippet for |
Perfect. So I confirm, from there are only two ways in pytest to share a fixture between two modules (in your case the module containing the cases contains the fixture on one hand, and the module using
See also pytest doc Still, I managed to create an experimental flag Let me know if this new feature, available in the 3.4.0 release this evening, works for you. Otherwise feel free to reopen this ticket |
@smarie Thanks a lot! I'll try it out and keep you posted. |
It seems that fixtures defined in case files can not be found.
Seems to be related to #174.
However, the workarounds/solutions described in #174 don't really work for my usecase, since I want to keep the fixture local to my cases file.
Example
File
test_foo_cases.py
:File
test_foo.py
:When running
test_foo
, I getThe text was updated successfully, but these errors were encountered: