Mock network call in test_version_command_execution

Fixes #3049 by mocking check_for_newer_version to prevent real network
calls to PyPI during tests, which was causing timeouts on Windows.

Co-authored-by: Bill Easton <strawgate@users.noreply.github.com>
This commit is contained in:
claude[bot] 2026-01-31 22:35:43 +00:00
commit cd085412d1

View file

@ -39,7 +39,8 @@ class TestMainCLI:
class TestVersionCommand:
"""Test the version command."""
def test_version_command_execution(self):
@patch("fastmcp.cli.cli.check_for_newer_version", return_value=None)
def test_version_command_execution(self, mock_check):
"""Test that version command executes properly."""
# The version command should execute without raising SystemExit
command, bound, _ = app.parse_args(["version"])