Replaced os.environ["PYTEST_VERSION"] = "old version" by monkeypatch.setenv("PYTEST_VERSION", "old version") to ensure this env variable is cleaned up after this ut, its a good practise to make sure one ut doesnt affect other uts unless theres a specific reason

This commit is contained in:
dheerajck 2024-04-19 00:08:45 +05:30
parent 48b6d18834
commit d97fe5663b
1 changed files with 1 additions and 1 deletions

View File

@ -1097,7 +1097,7 @@ def test_outcome_exception_bad_msg() -> None:
def test_pytest_version_env_var(pytester: Pytester, monkeypatch: MonkeyPatch) -> None:
os.environ["PYTEST_VERSION"] = "old version"
monkeypatch.setenv("PYTEST_VERSION", "old version")
pytester.makepyfile(
"""
import pytest