Skip to content

Commit

Permalink
test: fix completion test on GitHub CI.
Browse files Browse the repository at this point in the history
Replace rich.print with print builtin using monkeypatch. The additional
markup from rich.print causes issues with GitHub workflow runs.
  • Loading branch information
badshah400 committed Mar 2, 2024
1 parent 7537440 commit 55e11f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_bash_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def test_print(capsys):
def test_install(capsys, monkeypatch, tmpdir):
"""Test installed completions file"""
monkeypatch.setenv("HOME", str(tmpdir))
monkeypatch.setattr("rich.print", print)
with pytest.raises(SystemExit) as exc:
TarTeX(["--bash-completion"])

assert exc.value.code == 0
bc = BashCompletion()
print(bc.data, end="") # noqa: T201
compl_file = Path.home() / bc.install_dir / APPNAME
assert str(compl_file.parent) in capsys.readouterr().out
assert compl_file.exists()
Expand Down

0 comments on commit 55e11f2

Please sign in to comment.