Skip to content

Commit

Permalink
Merge pull request #25 from mgorny/nocolor-pytest
Browse files Browse the repository at this point in the history
Fix running the test suite when NO_COLOR is set in calling env
  • Loading branch information
r-m-n committed Nov 24, 2023
2 parents 6042d4c + 7603764 commit 354ed73
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest

import click
Expand All @@ -7,3 +9,12 @@
@pytest.fixture
def runner():
return CliRunner()


@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

0 comments on commit 354ed73

Please sign in to comment.