Enable more type checking rules (#1775)

This commit is contained in:
William Easton 2025-09-07 10:11:44 -05:00 committed by GitHub
commit fe4f31c2c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 404 additions and 177 deletions

View file

@ -32,6 +32,7 @@ class TestMainCLI:
"""Test parsing invalid environment variables exits."""
with pytest.raises(SystemExit) as exc_info:
_parse_env_var("INVALID_FORMAT")
assert isinstance(exc_info.value, SystemExit)
assert exc_info.value.code == 1
@ -47,14 +48,14 @@ class TestVersionCommand:
def test_version_command_parsing(self):
"""Test that the version command parses arguments correctly."""
command, bound, _ = app.parse_args(["version"])
assert command.__name__ == "version"
assert command.__name__ == "version" # type: ignore[attr-defined]
# Default arguments aren't included in bound.arguments
assert bound.arguments == {}
def test_version_command_with_copy_flag(self):
"""Test that the version command parses --copy flag correctly."""
command, bound, _ = app.parse_args(["version", "--copy"])
assert command.__name__ == "version"
assert command.__name__ == "version" # type: ignore[attr-defined]
assert bound.arguments == {"copy": True}
@patch("fastmcp.cli.cli.pyperclip.copy")