Saving two lines with suppress!

This commit is contained in:
Julien Palard 2023-03-13 14:00:12 +01:00
parent 045aea56c8
commit 15efeaa3de
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8

View File

@ -1,3 +1,4 @@
from contextlib import suppress
from pathlib import Path
import pytest
@ -16,10 +17,8 @@ def run_potodo(repo_dir, capsys, monkeypatch):
monkeypatch.setattr(
"sys.argv", ["potodo", "--no-cache", "-p", str(repo_dir)] + argv
)
try:
with suppress(SystemExit):
main()
except SystemExit:
pass
return capsys.readouterr()
return run_it