Skip to content

Commit d53e587

Browse files
committed
try to fix test with new rich
1 parent ba1281a commit d53e587

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/func/utils/test_strict_yaml.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,18 +323,14 @@ def force_posixpath(mocker):
323323

324324

325325
@pytest.fixture
326-
def fixed_width_term(mocker):
326+
def dumb_terminal(monkeypatch):
327327
"""Fixed width console."""
328-
from rich.console import Console
329-
330-
mocker.patch.object(
331-
Console, "width", new_callable=mocker.PropertyMock(return_value=80)
332-
)
328+
monkeypatch.setenv("TERM", "dumb")
333329

334330

335331
@pytest.mark.parametrize("text, expected", examples.values(), ids=examples.keys())
336332
def test_exceptions(
337-
tmp_dir, dvc, capsys, force_posixpath, fixed_width_term, text, expected
333+
tmp_dir, dvc, capsys, force_posixpath, dumb_terminal, text, expected
338334
):
339335
tmp_dir.gen("dvc.yaml", text)
340336

@@ -358,7 +354,7 @@ def test_exceptions(
358354
],
359355
)
360356
def test_on_revision(
361-
tmp_dir, scm, dvc, force_posixpath, fixed_width_term, capsys, text, expected
357+
tmp_dir, scm, dvc, force_posixpath, dumb_terminal, capsys, text, expected
362358
):
363359
tmp_dir.scm_gen("dvc.yaml", text, commit="add dvc.yaml")
364360
capsys.readouterr() # clear outputs

0 commit comments

Comments
 (0)