Skip to content

Conversation

@dzhalaevd
Copy link

@dzhalaevd dzhalaevd commented Jan 30, 2026

What was wrong?

using @pytest.fixture on async fixtures emitted only a deprecation warning, but plan was to make it an exception

Closes: #1202
Related issue: #1202

How it was fixed?

  • Raises pytest.UsageError instead of PytestDeprecationWarning when using @pytest.fixture on async fixtures in strict mode (I'm not really sure about pytest.UsageError because some different func uses usual ValueError)
  • Update test cases
  • Add changelog entry

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.64%. Comparing base (234b90d) to head (8ea2c92).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1348   +/-   ##
=======================================
  Coverage   93.64%   93.64%           
=======================================
  Files           2        2           
  Lines         409      409           
  Branches       44       44           
=======================================
  Hits          383      383           
  Misses         20       20           
  Partials        6        6           

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn deprecation of applying @pytest.fixture to async fixtures in strict mode into an error

2 participants