Skip to content

Correct @classmethod + @pytest.fixture decorator order#20116

Merged
czoido merged 2 commits into
conan-io:develop2from
czoido:fix-ci-tests
Jun 26, 2026
Merged

Correct @classmethod + @pytest.fixture decorator order#20116
czoido merged 2 commits into
conan-io:develop2from
czoido:fix-ci-tests

Conversation

@czoido

@czoido czoido commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Changelog: Omit
Docs: Omit

Commit 621a7a996 introduced @classmethod above @pytest.fixture to silence linter warnings. The correct order per pytest 8.1+ is the opposite: @pytest.fixture outermost, @classmethod innermost. With the wrong order pytest wraps the fixture in a classmethod descriptor it cannot detect, causing "fixture not found" and AttributeError: 'FixtureFunctionDefinition' has no attribute '__code__' errors.

@czoido czoido added this to the 2.30.0 milestone Jun 26, 2026
@czoido czoido merged commit 0821c4a into conan-io:develop2 Jun 26, 2026
33 of 35 checks passed
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.

1 participant