Skip to content

fix: validate asyncio_mode in pytest_configure - #1634

Closed
EnesKartal wants to merge 1 commit into
pytest-dev:mainfrom
EnesKartal:fix/validate-asyncio-mode-in-configure
Closed

EnesKartal wants to merge 1 commit into
pytest-dev:mainfrom
EnesKartal:fix/validate-asyncio-mode-in-configure

Conversation

@EnesKartal

Copy link
Copy Markdown

Summary

  • Call _get_asyncio_mode(config) in pytest_configure() (pytest_asyncio/plugin.py) so invalid asyncio_mode values fail fast at configuration time even when -q suppresses pytest_report_header.
  • Add regression test test_invalid_asyncio_mode_quiet in tests/test_simple.py.

Test Plan

  • .venv\Scripts\python.exe -m pytest tests/test_simple.py tests/modes/ -q --basetemp=.pytest-tmp -> all passed.

Fixes #1633

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (599fb32) to head (5eaf27b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1634      +/-   ##
==========================================
+ Coverage   94.86%   94.87%   +0.01%     
==========================================
  Files           2        2              
  Lines         506      507       +1     
  Branches       60       60              
==========================================
+ Hits          480      481       +1     
  Misses         21       21              
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid asyncio_mode is only validated when the report header is printed

3 participants