1
0
forked from clan/clan-core

clan-cli: fix tests

This commit is contained in:
DavHau 2023-07-21 14:07:38 +02:00
parent f370635518
commit 7223b25ac6
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ from . import admin
has_argcomplete = True
try:
import argcomplete
except ImportError:
except ImportError: # pragma: no cover
has_argcomplete = False
@ -25,5 +25,5 @@ def main() -> None:
parser.print_help()
if __name__ == "__main__":
if __name__ == "__main__": # pragma: no cover
main()

View File

@ -4,7 +4,8 @@ import clan_cli
import pytest
def test_no_args(capsys: pytest.CaptureFixture) -> None:
def test_no_args(capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(sys, "argv", [""])
clan_cli.main()
captured = capsys.readouterr()
assert captured.out.startswith("usage:")