def test_should_process_check_iscalled_with_valid_version(capsys): result = main(["check", "1.1.1"]) assert not result captured = capsys.readouterr() assert not captured.out
def test_should_process_raise_error(capsys): rc = main(["bump", "major", "1.2"]) assert rc != 0 captured = capsys.readouterr() assert captured.err.startswith("ERROR")
def test_should_raise_systemexit_when_bump_iscalled_with_empty_arguments(): with pytest.raises(SystemExit): main(["bump"])
def test_should_process_print(capsys): rc = main(["bump", "major", "1.2.3"]) assert rc == 0 captured = capsys.readouterr() assert captured.out.rstrip() == "2.0.0"