DEVX-7: fix: make all warnings into errors across devx tools

This commit is contained in:
2026-06-22 20:54:25 +00:00
parent 621b9936c8
commit 8411c92c95
20 changed files with 827 additions and 304 deletions
+11 -3
View File
@@ -84,6 +84,13 @@ class TestGetBumpedVersion:
with pytest.raises(click.ClickException):
get_bumped_version()
@patch("devx.ci.release.run_cmd")
def test_invalid_version_format_raises(self, mock_run_cmd: MagicMock) -> None:
"""Non-semver version from git-cliff should raise."""
mock_run_cmd.return_value = MagicMock(returncode=0, stdout="not-a-version\n", stderr="")
with pytest.raises(click.ClickException, match="invalid version format"):
get_bumped_version()
class TestGetChangelog:
@patch("devx.ci.release.run_cmd")
@@ -384,7 +391,7 @@ class TestMain:
@patch("devx.ci.release.get_bumped_version", return_value="0.2.0")
@patch("devx.ci.release.has_unreleased_changes", return_value=True)
@patch("devx.ci.release.run_cmd")
def test_dry_run_empty_changelog(
def test_dry_run_empty_changelog_fails(
self,
mock_run_cmd: MagicMock,
mock_has: MagicMock,
@@ -397,11 +404,12 @@ class TestMain:
mock_tag: MagicMock,
mock_user: MagicMock,
) -> None:
"""Empty changelog should fail, not warn."""
mock_run_cmd.return_value = MagicMock(returncode=0, stdout="master\n", stderr="")
runner = CliRunner()
result = runner.invoke(main, ["--dry-run"])
assert result.exit_code == 0
assert "empty changelog" in result.output
assert result.exit_code != 0
assert "empty changelog" in result.output.lower()
@patch.dict("os.environ", {})
@patch("devx.ci.release.has_user_facing_changes", return_value=True)