From 2b840411ff07ce5a96a1fa767b06abd0b4b611fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vlastimil=20Z=C3=ADma?= Date: Sun, 11 Aug 2024 17:52:11 +0200 Subject: [PATCH] fixup! Fix #3318 - Suppress spinner in parallel runs in CI --- tests/session/cmd/test_legacy.py | 3 +-- tests/session/cmd/test_parallel.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/session/cmd/test_legacy.py b/tests/session/cmd/test_legacy.py index c85fb82c72..a9747b3ba6 100644 --- a/tests/session/cmd/test_legacy.py +++ b/tests/session/cmd/test_legacy.py @@ -2,7 +2,6 @@ import os from typing import TYPE_CHECKING -from unittest.mock import patch import pytest @@ -127,7 +126,7 @@ def test_legacy_run_sequential_ci(tox_project: ToxProjectCreator, mocker: Mocker """Test legacy run sequential in CI by default.""" run_sequential = mocker.patch("tox.session.cmd.legacy.run_sequential") - with patch.dict(os.environ, {"CI": "1"}): + with mocker.patch.dict(os.environ, {"CI": "1"}): tox_project({"tox.ini": ""}).run("le", "-e", "py") assert run_sequential.call_count == 1 diff --git a/tests/session/cmd/test_parallel.py b/tests/session/cmd/test_parallel.py index ab75a62a69..baf2c51c00 100644 --- a/tests/session/cmd/test_parallel.py +++ b/tests/session/cmd/test_parallel.py @@ -187,9 +187,9 @@ def test_parallel_no_spinner(tox_project: ToxProjectCreator) -> None: ) -def test_parallel_no_spinner_ci(tox_project: ToxProjectCreator) -> None: +def test_parallel_no_spinner_ci(tox_project: ToxProjectCreator, mocker: MockerFixture) -> None: """Ensure spinner is disabled by default in CI.""" - with mock.patch.object(parallel, "execute") as mocked, mock.patch.dict(os.environ, {"CI": "1"}): + with mocker.patch.object(parallel, "execute") as mocked, mocker.patch.dict(os.environ, {"CI": "1"}): tox_project({"tox.ini": ""}).run("p") mocked.assert_called_once_with(