Skip to content

Set default asyncio fixture loop scope to function#1444

Open
SahilArchitect wants to merge 3 commits into
pytest-dev:mainfrom
SahilArchitect:fix-924-default-fixture-loop-scope
Open

Set default asyncio fixture loop scope to function#1444
SahilArchitect wants to merge 3 commits into
pytest-dev:mainfrom
SahilArchitect:fix-924-default-fixture-loop-scope

Conversation

@SahilArchitect
Copy link
Copy Markdown

Closes #924.

Summary

Sets the default value of asyncio_default_fixture_loop_scope to function and removes the deprecated unset
fallback/warning path.

This intentionally only changes the default for async fixture loop scope. It does not change async test loop scope
behavior, custom event_loop fixture deprecations, pytest warning filtering order, or quoted pytest.ini value
parsing.

Changes

  • Default unset asyncio_default_fixture_loop_scope to function
  • Remove the old fallback to fixture caching scope
  • Update docs and changelog wording
  • Add regression coverage for the unset/default behavior

Tests

  • python -m pytest tests/test_fixture_loop_scopes.py
  • python -m pytest tests/test_asyncio_fixture.py tests/modes/test_auto_mode.py tests/modes/test_strict_mode.py

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (74a5557) to head (d70eb97).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1444      +/-   ##
==========================================
+ Coverage   94.50%   94.87%   +0.36%     
==========================================
  Files           2        2              
  Lines         510      507       -3     
  Branches       62       61       -1     
==========================================
- Hits          482      481       -1     
+ Misses         22       21       -1     
+ Partials        6        5       -1     

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

Finish deprecation of unset asyncio_default_fixture_loop_scope

2 participants