Skip to content

AI junk#6083

Closed
Hasnaathussain wants to merge 1 commit into
pallets:mainfrom
Hasnaathussain:fix/6071-pytest-9-1-notset-collection-crash
Closed

AI junk#6083
Hasnaathussain wants to merge 1 commit into
pallets:mainfrom
Hasnaathussain:fix/6071-pytest-9-1-notset-collection-crash

Conversation

@Hasnaathussain

@Hasnaathussain Hasnaathussain commented Jul 7, 2026

Copy link
Copy Markdown

pytest 9.1 removed the internal notset sentinel object from _pytest.monkeypatch (moving it to _pytest.compat.NOTSET). This causes a collection-time crash because the test suite imports notset from the old location in conftest.py and test_cli.py.

We resolve this by falling back to import NOTSET from _pytest.compat first, then _pytest.monkeypatch for backward compatibility.

pytest 9.1 removed the internal 'notset' sentinel object from '_pytest.monkeypatch' (moving it to '_pytest.compat.NOTSET'). This causes a collection-time crash because the test suite imports 'notset' from the old location in conftest.py and test_cli.py.

We resolve this by falling back to import NOTSET from '_pytest.compat' first, then '_pytest.monkeypatch' for backward compatibility.
@davidism davidism closed this Jul 7, 2026
@davidism davidism changed the title fix: resolve test collection crash under pytest 9.1 AI junk Jul 7, 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.

2 participants