Skip to content
Closed

AI junk #6087

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import pytest
from _pytest import monkeypatch

try:
from _pytest.monkeypatch import notset
except ImportError:
from _pytest.compat import NOTSET as notset

from flask import Flask
from flask.globals import app_ctx as _app_ctx

Expand All @@ -16,15 +21,15 @@ def _standard_os_environ():
"""
mp = monkeypatch.MonkeyPatch()
out = (
(os.environ, "FLASK_ENV_FILE", monkeypatch.notset),
(os.environ, "FLASK_APP", monkeypatch.notset),
(os.environ, "FLASK_DEBUG", monkeypatch.notset),
(os.environ, "FLASK_RUN_FROM_CLI", monkeypatch.notset),
(os.environ, "WERKZEUG_RUN_MAIN", monkeypatch.notset),
(os.environ, "FLASK_ENV_FILE", notset),
(os.environ, "FLASK_APP", notset),
(os.environ, "FLASK_DEBUG", notset),
(os.environ, "FLASK_RUN_FROM_CLI", notset),
(os.environ, "WERKZEUG_RUN_MAIN", notset),
)

for _, key, value in out:
if value is monkeypatch.notset:
if value is notset:
mp.delenv(key, False)
else:
mp.setenv(key, value)
Expand Down
6 changes: 5 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

import click
import pytest
from _pytest.monkeypatch import notset

try:
from _pytest.monkeypatch import notset
except ImportError:
from _pytest.compat import NOTSET as notset
from click.testing import CliRunner

from flask import Blueprint
Expand Down