Skip to content

AI junk#6087

Closed
mohamedjaazeer4-sketch wants to merge 1 commit into
pallets:mainfrom
mohamedjaazeer4-sketch:fix-pytest-91-notset
Closed

AI junk#6087
mohamedjaazeer4-sketch wants to merge 1 commit into
pallets:mainfrom
mohamedjaazeer4-sketch:fix-pytest-91-notset

Conversation

@mohamedjaazeer4-sketch

Copy link
Copy Markdown

Summary

Updates Flask's tests to support pytest 9.1, where the notset sentinel is no longer available from _pytest.monkeypatch.

The tests now use a small compatibility import:

  • older pytest: _pytest.monkeypatch.notset
  • pytest 9.1+: _pytest.compat.NOTSET

This keeps the existing monkeypatch behavior while allowing the test suite to collect and run with pytest 9.1.

Problem observed

With pytest 9.1.1, test collection failed with:

ImportError: cannot import name 'notset' from '_pytest.monkeypatch'

Validation

pytest 9.1.1:

uv run --with pytest==9.1.1 pytest tests/

Result:

491 passed

Current project pytest:

uv run pytest tests/

Result:

491 passed

Ruff check:

uv run ruff check tests/conftest.py tests/test_cli.py

Result:

All checks passed!

Related issue

Fixes #6071.

@davidism davidism closed this Jul 8, 2026
@davidism davidism changed the title Support pytest 9.1 notset sentinel change AI junk Jul 8, 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