forked from clan/clan-core
clan-cli: fix tests
This commit is contained in:
parent
f370635518
commit
7223b25ac6
@ -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()
|
||||
|
@ -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:")
|
||||
|
Loading…
Reference in New Issue
Block a user