Skip to content

Commit d9a9c7b

Browse files
jeremymanningclaude
andcommitted
Fix CLI test compatibility across Python versions
Fix tests/test_cli.py::TestCLI::test_cli_no_command for Python 3.8/3.9 compatibility. Click behavior varies between versions: - Python 3.10+: Returns exit code 2 when no command given - Python 3.8/3.9: Returns exit code 0 when no command given Updated test to accept both exit codes [0, 2] while still verifying that help text is displayed correctly. Resolves GitHub Actions test failures on Python 3.8 and 3.9 matrices. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent be85fe8 commit d9a9c7b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,6 @@ def test_status_connection_failed(
186186
def test_cli_no_command(self, runner):
187187
"""Test CLI with no command shows help."""
188188
result = runner.invoke(cli, [])
189-
assert result.exit_code == 2 # Click returns 2 when no command is given
189+
# Click behavior varies by version: may return 0 or 2 when no command is given
190+
assert result.exit_code in [0, 2]
190191
assert "Clustrix CLI" in result.output

0 commit comments

Comments
 (0)