Skip to content

Commit 251d800

Browse files
committed
Fix Windows CI: Add create=True to os.getloadavg patch
- Use create=True parameter to allow patching non-existent attributes - Fixes Windows test failures where os.getloadavg doesn't exist - Mock creates the attribute instead of failing to find original - Should now work across all platforms
1 parent 8792ae3 commit 251d800

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def mock_windows_specific_functions():
1111
"""Mock Windows-incompatible functions for all tests."""
1212
# Only apply this mock on Windows or if getloadavg doesn't exist
1313
if not hasattr(os, 'getloadavg'):
14-
with patch('system_info_mcp.tools.os.getloadavg', return_value=(0.1, 0.1, 0.1)):
14+
with patch('system_info_mcp.tools.os.getloadavg', return_value=(0.1, 0.1, 0.1), create=True):
1515
yield
1616
else:
1717
yield

0 commit comments

Comments
 (0)