Skip to content

AI junk#6088

Closed
Muhtasim-Munif-Fahim wants to merge 1 commit into
pallets:mainfrom
Muhtasim-Munif-Fahim:codex/flask-pytest-9-monkeypatch-compat
Closed

AI junk#6088
Muhtasim-Munif-Fahim wants to merge 1 commit into
pallets:mainfrom
Muhtasim-Munif-Fahim:codex/flask-pytest-9-monkeypatch-compat

Conversation

@Muhtasim-Munif-Fahim

Copy link
Copy Markdown

Closes #6071

Avoid private pytest monkeypatch internals in the test suite so collection works with pytest 9.1, where notset is no longer exported from _pytest.monkeypatch.

  • Set the Flask CLI environment baseline with public monkeypatch.delenv(..., raising=False) calls for each test.
  • Replace direct _setitem manipulation in dotenv tests with an explicit fixture that ensures their test variables are absent before and after each test.

The existing per-test environment isolation is preserved without relying on pytest's internal sentinel or undo-stack representation.

Tests:

  • .venv\\Scripts\\python.exe -m pytest tests/test_cli.py -q (58 passed)
  • .venv\\Scripts\\python.exe -m pytest tests -q (491 passed)
  • .venv\\Scripts\\ruff.exe check tests/conftest.py tests/test_cli.py

@ThiefMaster ThiefMaster changed the title test: avoid private pytest monkeypatch internals AI junk Jul 9, 2026
@ThiefMaster ThiefMaster closed this Jul 9, 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