Files
clan-core/templates/python-project/tests/test_cli.py
Jörg Thalheim 0b654c7434 apply treefmt
2023-07-21 14:11:46 +02:00

21 lines
459 B
Python

import sys
import pytest
import my_tool
def test_no_args(capsys: pytest.CaptureFixture) -> None:
my_tool.my_cli()
captured = capsys.readouterr()
assert captured.out.startswith("usage:")
def test_version(
capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch
) -> None:
monkeypatch.setattr(sys, "argv", ["", "--version"])
my_tool.my_cli()
captured = capsys.readouterr()
assert captured.out.startswith("Version:")