Skip to content

AI junk#6078

Closed
ishaanlabs-gg wants to merge 1 commit into
pallets:mainfrom
ishaanlabs-gg:fix-pytest-91-notset
Closed

AI junk#6078
ishaanlabs-gg wants to merge 1 commit into
pallets:mainfrom
ishaanlabs-gg:fix-pytest-91-notset

Conversation

@ishaanlabs-gg

@ishaanlabs-gg ishaanlabs-gg commented Jul 2, 2026

Copy link
Copy Markdown

Use the monkeypatch module's current sentinel name instead of importing the removed _pytest.monkeypatch.notset symbol directly.

Pytest 9.1 exposes the sentinel as _pytest.monkeypatch.NOTSET, while pytest 9.0 still uses _pytest.monkeypatch.notset. This keeps the existing monkeypatch bookkeeping behavior on both versions, while allowing Flask's tests to collect and run with pytest 9.1.

This also keeps CertParamType generic for static type checkers while avoiding runtime subscripting of click.ParamType on older supported Click versions, and avoids Werkzeug main deprecation warnings in tests by preferring the newer datastructure parsing helpers when they are available.

fixes #6071

Validation:

  • With pytest 9.0.3 / Click 8.1.3 / Werkzeug 3.1.0:
    • python -m pytest tests -q
  • With pytest 9.1.1 / Click 8.4.2 / Werkzeug 3.1.8:
    • python -m pytest tests -q
  • python -m mypy
  • pyright --pythonpath <venv>/bin/python
  • python -m py_compile src/flask/cli.py tests/conftest.py tests/test_cli.py tests/test_blueprints.py tests/test_views.py
  • python -m ruff check src/flask/cli.py tests/conftest.py tests/test_cli.py tests/test_blueprints.py tests/test_views.py
  • git diff --check

@davidism davidism closed this Jul 2, 2026
@davidism davidism changed the title Fix pytest 9.1 monkeypatch sentinel imports AI junk Jul 2, 2026
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.

Tests fail with pytest 9.1: _pytest.monkeypatch.notset removed

2 participants