-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fixture with scope “class” running for every method #2938
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
After a bit more of research, I guess this may be a duplicated of issue #570. |
Indeed seems like a duplicate, but let's keep this open because your example code might be useful. |
I think that I run into similar issue while trying to figure out how the scopes work. in my conftest.py
in my pytest.ini and in my test module 'test_module_b.py'
And the output of 'pytest -s' for that is:
session and module fixtures are run as expected but I think that class fixtures shouldn't be run here. |
Using pytest version |
I cannot reproduce the original issue from the stack overflow post, so closing. @fkudron-home please open a new issue if you still have this problem, however I think this is intended behavior (not sure). @rafaelcs Please open a new issue with a way to reproduce the problem you're seeing. |
I'm having a problem with fixture scopes and I wonder if this can be a bug. I'm running Pytest 3.2.5 with Python 3. I basically want to apply a fixture with scope "class" but parametrizing the fixture. The idea is to have groups of tests defined by classes, and to run those groups with different configurations. But when I apply also a fixture with scope "function", that seems to affect also the "class" fixture.
I have a question with an example code in Stack Overflow: https://stackoverflow.com/questions/47312835/pytest-fixture-with-scope-class-running-on-every-method
The text was updated successfully, but these errors were encountered: