Skip to content

Conversation

@The-Compiler
Copy link
Member

While obvious in hindsight, this error message confused me. I thought my fixture function was used in a test function twice, since the wording is ambiguous.

Also, the error does not tell me which function is the culprit.

Finally, this adds a test, which wasn't done in
cfd16d0 where this was originally implemented.

While obvious in hindsight, this error message confused me. I thought my fixture
function was used in a test function twice, since the wording is ambiguous.

Also, the error does not tell me *which* function is the culprit.

Finally, this adds a test, which wasn't done in
cfd16d0 where this was originally implemented.
@The-Compiler The-Compiler added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Dec 5, 2023
@bluetech
Copy link
Member

bluetech commented Feb 9, 2024

@The-Compiler is this ready to merge or still needs work?

@The-Compiler
Copy link
Member Author

Thanks for the reminder, completely forgot about this! Good to merge I'd say.

@The-Compiler The-Compiler merged commit 7690a0d into pytest-dev:main Feb 9, 2024
flying-sheep pushed a commit to flying-sheep/pytest that referenced this pull request Apr 9, 2024
)

* Improve error message when using @pytest.fixture twice

While obvious in hindsight, this error message confused me. I thought my fixture
function was used in a test function twice, since the wording is ambiguous.

Also, the error does not tell me *which* function is the culprit.

Finally, this adds a test, which wasn't done in
cfd16d0 where this was originally implemented.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants