Skip to content

Commit 4d379b5

Browse files
committed
use contextlib.suppress for a couple of tests
1 parent d634070 commit 4d379b5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Diff for: tests/cli_test.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
from __future__ import annotations
22

3+
import contextlib
4+
35
import pytest
46

57
from bmipy._cmd import main
68

79

810
def test_cli_version(capsys):
9-
try:
11+
with contextlib.suppress(SystemExit):
1012
assert main(["--version"]) == 0
11-
except SystemExit:
12-
pass
1313
output = capsys.readouterr().out
1414

1515
assert "bmipy" in output
1616

1717

1818
def test_cli_help(capsys):
19-
try:
19+
with contextlib.suppress(SystemExit):
2020
assert main(["--help"]) == 0
21-
except SystemExit:
22-
pass
2321
output = capsys.readouterr().out
2422

2523
assert "help" in output

0 commit comments

Comments
 (0)