Skip to content

Commit 7a2f5b3

Browse files
Workaround to disable rich output to make testing on github actions easier.
Co-authored-by: Piotr Kaznowski <[email protected]>
1 parent ee570da commit 7a2f5b3

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

tests/test_cli_pa.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import typer.core
2+
13
from typer.testing import CliRunner
24

35
from cli.pa import app
46

7+
typer.core.rich = None # Workaround to disable rich output to make testing on github actions easier
8+
# TODO: remove this workaround
59
runner = CliRunner()
610

711

@@ -11,13 +15,10 @@ def test_main_command_without_args_prints_help():
1115
[],
1216
)
1317
assert result.exit_code == 0
14-
tidied_output = " ".join([line.replace("│", "").strip() for line in result.output.split("\n")])
15-
assert "This is a new experimental PythonAnywhere cli client." in tidied_output
16-
assert "Makes Django Girls tutorial projects deployment easy" in tidied_output
17-
assert "Perform some operations on files" in tidied_output
18-
assert "Manage scheduled tasks" in tidied_output
19-
assert "Perform some operations on students" in tidied_output
20-
assert "Everything for web apps: use this if you're not using our experimental features" in tidied_output
21-
assert "EXPERIMENTAL: create and manage ASGI websites" in tidied_output
22-
23-
18+
assert "This is a new experimental PythonAnywhere cli client." in result.stdout
19+
assert "Makes Django Girls tutorial projects deployment easy" in result.stdout
20+
assert "Perform some operations on files" in result.stdout
21+
assert "Manage scheduled tasks" in result.stdout
22+
assert "Perform some operations on students" in result.stdout
23+
assert "Everything for web apps: use this if you're not using" in result.stdout
24+
assert "EXPERIMENTAL: create and manage ASGI websites" in result.stdout

0 commit comments

Comments
 (0)