From 13589da335545f8af5a4ffb328a352349b1f27ee Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 5 Jan 2022 14:40:36 +0000 Subject: [PATCH] for environment to empty in tests --- Makefile | 2 +- tests/test_console.py | 2 +- tests/test_layout.py | 2 +- tests/test_spinner.py | 2 +- tests/test_tree.py | 8 ++++++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 56977d2c..17ede926 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ test: - pytest --cov-report term-missing --cov=rich tests/ -vv + TERM=unknown pytest --cov-report term-missing --cov=rich tests/ -vv format-check: black --check . format: diff --git a/tests/test_console.py b/tests/test_console.py index 4b21e397..0989d8ba 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -686,7 +686,7 @@ def test_is_alt_screen(): def test_update_screen(): - console = Console(force_terminal=True, width=20, height=5) + console = Console(force_terminal=True, width=20, height=5, _environ={}) if console.legacy_windows: return with pytest.raises(errors.NoAltScreen): diff --git a/tests/test_layout.py b/tests/test_layout.py index 21d30d27..61cc9b6b 100644 --- a/tests/test_layout.py +++ b/tests/test_layout.py @@ -86,7 +86,7 @@ def test_tree(): def test_refresh_screen(): layout = Layout() layout.split_row(Layout(name="foo"), Layout(name="bar")) - console = Console(force_terminal=True, width=20, height=5) + console = Console(force_terminal=True, width=20, height=5, _environ={}) with console.capture(): console.print(layout) with console.screen(): diff --git a/tests/test_spinner.py b/tests/test_spinner.py index 5560f1da..98e3d9d6 100644 --- a/tests/test_spinner.py +++ b/tests/test_spinner.py @@ -41,7 +41,7 @@ def test_spinner_update(): nonlocal time return time - console = Console(width=20, force_terminal=True, get_time=get_time) + console = Console(width=20, force_terminal=True, get_time=get_time, _environ={}) console.begin_capture() spinner = Spinner("dots") console.print(spinner) diff --git a/tests/test_tree.py b/tests/test_tree.py index 8fc070d3..f5510aa5 100644 --- a/tests/test_tree.py +++ b/tests/test_tree.py @@ -67,7 +67,9 @@ def test_render_tree_non_win32(): baz_tree.add("2") tree.add("egg") - console = Console(width=20, force_terminal=True, color_system="standard") + console = Console( + width=20, force_terminal=True, color_system="standard", _environ={} + ) console.begin_capture() console.print(tree) result = console.end_capture() @@ -103,7 +105,9 @@ def test_render_tree_hide_root_non_win32(): baz_tree.add("2") tree.add("egg") - console = Console(width=20, force_terminal=True, color_system="standard") + console = Console( + width=20, force_terminal=True, color_system="standard", _environ={} + ) console.begin_capture() console.print(tree) result = console.end_capture()