Skip to content

Commit

Permalink
fixup! Fix #3318 - Suppress spinner in parallel runs in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ziima committed Aug 11, 2024
1 parent 592edf6 commit 2b84041
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/session/cmd/test_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import os
from typing import TYPE_CHECKING
from unittest.mock import patch

import pytest

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/session/cmd/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2b84041

Please sign in to comment.