diff --git a/tests/plugins/test_packager_bugzilla_sync.py b/tests/plugins/test_packager_bugzilla_sync.py index 104aeac..3019b64 100644 --- a/tests/plugins/test_packager_bugzilla_sync.py +++ b/tests/plugins/test_packager_bugzilla_sync.py @@ -118,12 +118,15 @@ class TestPackagerBugzillaSyncToddler: def test_main_no_args(self, capsys): with pytest.raises(SystemExit): toddlers.plugins.packager_bugzilla_sync.main([]) + out, err = capsys.readouterr() - exp = """usage: pytest [-h] [--dry-run] [-q | --debug] conf [username] -pytest: error: the following arguments are required: conf -""" assert out == "" - assert err == exp + # Expecting something along these lines, but don't make the test too tight: + # + # usage: pytest [-h] [--dry-run] [-q | --debug] conf [username] + # pytest: error: the following arguments are required: conf + assert err.startswith("usage:") + assert "error: the following arguments are required:" in err @patch("toml.load", new=Mock(return_value={})) def test_main_debug(self, capsys): diff --git a/tests/test_playtime.py b/tests/test_playtime.py index 5a918be..4220e00 100644 --- a/tests/test_playtime.py +++ b/tests/test_playtime.py @@ -12,12 +12,15 @@ class TestPlaytime: def test_playtime_no_args(self, capsys): with pytest.raises(SystemExit): toddlers.playtime.main([]) + out, err = capsys.readouterr() - exp = """usage: pytest [-h] [--conf CONF] [--debug] name -pytest: error: the following arguments are required: name -""" assert out == "" - assert err == exp + # Expecting something along these lines, but don't make the test too tight: + # + # usage: pytest [-h] [--conf CONF] [--debug] name + # pytest: error: the following arguments are required: name + assert err.startswith("usage:") + assert "error: the following arguments are required:" in err def test_playtime_arg(self, capsys): with fedora_messaging.testing.mock_sends(