Skip to content

Commit

Permalink
Merge pull request #26 from mgorny/nocolor-pytest-r1
Browse files Browse the repository at this point in the history
Simplify clean_env() fixture
  • Loading branch information
r-m-n committed Nov 25, 2023
2 parents 354ed73 + 5c50df4 commit 5d42a55
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

import pytest

import click
Expand All @@ -12,9 +10,6 @@ def runner():


@pytest.fixture(autouse=True)
def clean_env():
old = dict(os.environ)
os.environ.pop("FORCE_COLOR", None)
os.environ.pop("NO_COLOR", None)
yield
os.environ = old
def clean_env(monkeypatch):
monkeypatch.delenv("FORCE_COLOR", raising=False)
monkeypatch.delenv("NO_COLOR", raising=False)

0 comments on commit 5d42a55

Please sign in to comment.