-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Regression: duplicate 'fixt' when overriding parametrized fixture with parametrize #979
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
can you please check if it matters that the fixture is defined in same module? |
If I have a import pytest
@pytest.mark.parametrize('fixt, val', [(3, 'x'), (4, 'x')])
def test_foo(fixt, val):
pass and a import pytest
@pytest.fixture(params=[1, 2])
def fixt(request):
return request.param
def test_bar(fixt):
pass that seems to work:
When I have the fixture in |
does the test folder have init.py? |
no:
|
try to add init.py, sorry being boring :) |
Adding an http://www.the-compiler.org | [email protected] (Mail/XMPP) |
you're right - checked the pytest/testing/python/fixture.py Line 227 in 73fdda0
would you mind to add such? and probably work on a fix? |
I can add a test, but that probably won't help much without a fix seeing that I already have a minimal testcase above. As for the fix, I don't really understand the fixture code and I'm quite busy with my own project - so I'd really appreciate if @untitaker or someone else could take a look! |
well, making test fail is a big first step anyway! |
@The-Compiler I think @bubenkoff is asking for you to write a test for it and mark it as But of course, if you don't have the time that's understandable! 😄 |
thanks @nicoddemus :) |
I currently don't have the time for this, but I suspect that in my commit, the condition should've been refined instead of removed (as discussed with @RonnyPfannschmidt in the PR). On 28 August 2015 15:01:04 CEST, Bruno Oliveira [email protected] wrote:
Sent from my phone. Please excuse my brevity. |
This is the one: #926 |
I took a look at what's going on and submitted a fix in #983 😄 |
This test:
works with 2.7.2 but fails since #926 / 41cef6f:
It only seems to fail if:
I agree overriding a fixture this way is a bit weird, but I think it should still work.
/cc @untitaker @bubenkoff
by the way - thanks to git bisect this was easy to find out:
The text was updated successfully, but these errors were encountered: