Skip to content

Commit 8afbf6f

Browse files
committed
Fix agent test script (test_agent.py) to handle recent changes (thanks @rkoumis)
1 parent 9c8abc0 commit 8afbf6f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

agent/test_agent.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pathlib
1010
import random
1111
import shutil
12+
import subprocess
1213
import sys
1314
import tempfile
1415
import time
@@ -39,8 +40,8 @@ class TestAgentFunctions:
3940
@mock.patch("sys.platform", "win32")
4041
def test_get_subprocess_259(self):
4142
mock_process_id = 999998
42-
mock_subprocess = mock.Mock(spec=multiprocessing.Process)
43-
mock_subprocess.exitcode = 259
43+
mock_subprocess = mock.Mock(spec=subprocess.Popen)
44+
mock_subprocess.poll = mock.Mock(return_value=259)
4445
mock_subprocess.pid = mock_process_id
4546
with mock.patch.dict(agent.state, {"async_subprocess": mock_subprocess}):
4647
actual = agent.get_subprocess_status()

0 commit comments

Comments
 (0)