Skip to content

Commit 21c0deb

Browse files
committed
Fix test_app_help to use monkeypatch instead of pytest.raises for SystemExit
(I don't like this, I got to research better alternative)
1 parent 3c508eb commit 21c0deb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/test_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ def test_app_creation(self):
1313
assert "keyup" in app.name
1414
assert "console-based client for ClickUp" in app.help
1515

16-
def test_app_help(self, capsys):
16+
def test_app_help(self, capsys, monkeypatch):
1717
"""Test that --help works."""
18-
import pytest
18+
import sys
1919

20-
with pytest.raises(SystemExit):
21-
app(["--help"])
20+
monkeypatch.setattr(sys, "exit", lambda x: None)
21+
app(["--help"])
2222
captured = capsys.readouterr()
2323
assert "Team ID" in captured.out
2424
assert "Space ID" in captured.out

0 commit comments

Comments
 (0)