-
Notifications
You must be signed in to change notification settings - Fork 106
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 are not meant to be called directly #60
Comments
Any updates on this ? Using pytest major version 4 breaks builds instead of just raising a warning. |
Thanks for the report! I'll take a look into this when I get some cycles and report back. In the meantime, the larger issue with pytest 4 is here: #34 I'll post an update when I've figured out how to get this working. |
Calling fixture directly feature is deprecated in 4.0 version. Install 3.10.0 version. It will work |
I don't think there's an easy fix for this, but it can be done with a call to EDIT: I just looked again at what you're trying to do, and I think it will not be possible to use a fixture in this way with pytest 4. In order to parameterize the test, the parameters must be available outside of the test context -- but fixtures in pytest 4 cannot be run outside of a test context. If you need this to be a fixture because you use it as a fixture elsewhere, consider a layer of indirection (i.e. have the fixture call a non-fixture function that produces these values). |
Hey folks - after consultation with @asher-dev, I don't believe this is a feature parameterized should support. As mentioned, this appears to be an abuse (or, at least, misuse) of pytest fixtures as implemented in pytest4… so it might be possible to hack around, but I don't believe there's a strong usecase. If you believe you have a usecase that is inline with "correct" pytest fixture usage, please comment here; I'm happy to reopen the issue if my understanding is faulty. |
With pytest 4.1.0, it is no longer possible to pass a fixture to a parameterized test:
Is there any workaround ? Ideally I would like to avoid passing a regular function (unless for some reason it's bad behavior) because my fixture is dependent on another fixture
The text was updated successfully, but these errors were encountered: