diff --git a/tests/test_medium.py b/tests/test_medium.py index 04b933c..65b4c32 100644 --- a/tests/test_medium.py +++ b/tests/test_medium.py @@ -108,7 +108,7 @@ def test_write_empty_content(self): class TestRunCommandEdges(unittest.TestCase): def test_timeout(self): - result = run_command("sleep 10", timeout=1) + result = run_command(f'"{sys.executable}" -c "import time; time.sleep(10)"', timeout=1) self.assertEqual(result["returncode"], -1) self.assertIn("timed out", result["stderr"]) @@ -128,7 +128,7 @@ def test_custom_timeout_via_dispatch(self): def test_pipe_command(self): result = dispatch("run_command", json.dumps({ - "command": "echo hello world | grep hello", + "command": f'"{sys.executable}" -c "print(\'hello world\')" | "{sys.executable}" -c "import sys; print(sys.stdin.read())"', })) self.assertIn("hello world", result)