Skip to content

Testcase for overriding autouse fixture with a parametrized fixture. #1755

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

Merged
merged 1 commit into from
Jul 23, 2016

Conversation

diegorusso
Copy link
Contributor

@diegorusso diegorusso commented Jul 23, 2016

I wasn't able to replicate the problem with the current master and the latest version (2.9.2). The test case was not present though so I created one.
pytest will raise a ValueError "Duplicate '<fixture_name>'" when overriding an autouse fixture w/ a parametrized fixture in a subdirectory's conftest.py

The related issue is #1601

Cheers

@coveralls
Copy link

coveralls commented Jul 23, 2016

Coverage Status

Coverage remained the same at 92.29% when pulling 267dcd5 on diegorusso:master into 018acc6 on pytest-dev:master.

@coveralls
Copy link

coveralls commented Jul 23, 2016

Coverage Status

Coverage remained the same at 92.29% when pulling 1bd8e55 on diegorusso:master into 018acc6 on pytest-dev:master.

@@ -336,6 +336,38 @@ def test_spam(spam):
result = testdir.runpytest(testfile)
result.stdout.fnmatch_lines(["*3 passed*"])

def test_override_autouse_fixture_with_parametrized_fixture_conftest_conftest(self, testdir):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to have conftest_conftest here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was deliberate. I've just followed the convention in the file from other tests.

Test case for overriding autouse fixture with a parametrized fixture.
The test covers the problem explained in the issue 1601
Adding Diego Russo to AUTHORS
@tomviner
Copy link
Contributor

Looks good to me 👍

@coveralls
Copy link

coveralls commented Jul 23, 2016

Coverage Status

Coverage remained the same at 92.29% when pulling 1704b7d on diegorusso:master into 018acc6 on pytest-dev:master.

@nicoddemus
Copy link
Member

Thanks @diegorusso, appreciate it!

@nicoddemus nicoddemus merged commit 655df7f into pytest-dev:master Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants