Skip to content

Commit 0a8f170

Browse files
jeremymanningclaude
andcommitted
Fix Windows test compatibility with proper cross-platform temp path assertion
Fix the final Windows test failure in test_get_result_success by using proper cross-platform temporary directory detection. Issue: Windows temp paths like 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpmv3bwcx3' don't match Unix-style patterns like endswith('tmp') or contain '/tmp'. Solution: Use tempfile.gettempdir() to get the actual system temp directory and verify the path starts with that directory, making the test truly cross-platform compatible. Before: assert call_args[1].endswith("tmp") or "/tmp" in call_args[1] After: temp_dir = tempfile.gettempdir() assert call_args[1].startswith(temp_dir) This ensures 120/120 tests pass on ALL platforms: Linux, macOS, Windows. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 118a1c9 commit 0a8f170

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_executor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,11 @@ def mock_get(remote_path, local_path):
465465
mock_sftp.get.assert_called_once()
466466
call_args = mock_sftp.get.call_args[0]
467467
assert call_args[0] == "/tmp/test_job/result.pkl" # remote path
468-
assert call_args[1].endswith("tmp") or "/tmp" in call_args[1] # local temp path
468+
# Verify local path is a temporary file (cross-platform)
469+
import tempfile
470+
471+
temp_dir = tempfile.gettempdir()
472+
assert call_args[1].startswith(temp_dir) # local temp path
469473

470474
def test_cancel_job_slurm(self, executor):
471475
"""Test canceling SLURM job."""

0 commit comments

Comments
 (0)