diff --git a/tests/cli/test_cli.py b/tests/cli/test_cli.py index 0fd3b72..826f82f 100644 --- a/tests/cli/test_cli.py +++ b/tests/cli/test_cli.py @@ -41,9 +41,11 @@ def patcher_cli_name( class TestInit: @pytest.fixture - def runner_noenv(self, credentials: FakeCredentials) -> Runner: - """Runner with no env variables set.""" - return Runner(credentials.SHARECODE) + def runner_noenv(self, runner: Runner, monkeypatch: pytest.MonkeyPatch) -> Runner: + """Runner with no auth env variables set.""" + monkeypatch.delenv(cli.API_USER_ENV_VAR) + monkeypatch.delenv(cli.API_KEY_ENV_VAR) + return runner @pytest.mark.parametrize("valid", [True, False]) def test_init( diff --git a/tests/conftest.py b/tests/conftest.py index 92fb344..d4bc33a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -79,9 +79,10 @@ def run(self, *args: str) -> click.testing.Result: @pytest.fixture def runner(monkeypatch: pytest.MonkeyPatch, credentials: FakeCredentials) -> Runner: - rich.reconfigure(width=80, no_color=True) - monkeypatch.setenv("COLUMNS", "80") # for future console instances - monkeypatch.setenv("NO_COLOR", "1") + rich.reconfigure(width=80, force_terminal=False) + # for future console instances + monkeypatch.setenv("COLUMNS", "80") + monkeypatch.setenv("TERM", "dumb") monkeypatch.setenv(cli.API_USER_ENV_VAR, credentials.USERNAME) monkeypatch.setenv(cli.API_KEY_ENV_VAR, credentials.API_KEY) return Runner(credentials.SHARECODE)