Skip to content

Conversation

@cjwatson
Copy link

@cjwatson cjwatson commented Jan 1, 2026

https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function notes that applying a mark to a fixture function never had any effect. It raises an exception during test collection with pytest 9.

https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
notes that applying a mark to a fixture function never had any effect.
It raises an exception during test collection with pytest 9.
@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.28%. Comparing base (3539e7d) to head (78d62f4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #986      +/-   ##
==========================================
+ Coverage   88.18%   88.28%   +0.09%     
==========================================
  Files          32       32              
  Lines        1007     1007              
  Branches      105      105              
==========================================
+ Hits          888      889       +1     
+ Misses        101      100       -1     
  Partials       18       18              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cclauss
Copy link
Contributor

cclauss commented Jan 1, 2026

@cjwatson
Copy link
Author

cjwatson commented Jan 1, 2026

I'm not sure I understand the question, sorry. The rule that you can't use marks on fixtures comes from pytest itself.

class test_DatabaseSchedulerFromAppConf(SchedulerCase):
Scheduler = TrackingScheduler

@pytest.mark.django_db
Copy link
Member

Choose a reason for hiding this comment

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

why removing this?

Copy link
Author

Choose a reason for hiding this comment

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

The link I posted in the issue description explains it. This is a mark applied to a fixture function. With pytest<9 it was a no-op; with pytest>=9 it is an error. It doesn't matter what the mark is.

The mark that actually matters is the one applied to the class, which my PR doesn't touch.

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.

3 participants