Skip to content

Commit 1053b02

Browse files
authored
Update api_test.py
1 parent 44f8f8a commit 1053b02

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

torchx/runner/test/api_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ def test_validate_invalid_replicas(self, _) -> None:
105105
with self.assertRaises(ValueError):
106106
runner.run(app, scheduler="local_dir")
107107

108-
@patch("torchx.util.session.uuid")
108+
@patch("torchx.util.session.uuid.uuid4")
109109
def test_session_id(self, uuid_mock: MagicMock, record_mock: MagicMock) -> None:
110-
uuid_mock.uuid4.return_value = "test_session_id"
110+
uuid_mock.return_value = "test_session_id"
111111
test_file = self.tmpdir / "test_file"
112112

113113
with self.get_runner() as runner:
@@ -128,15 +128,15 @@ def test_session_id(self, uuid_mock: MagicMock, record_mock: MagicMock) -> None:
128128
none_throws(runner.wait(app_handle_2, wait_interval=0.1))
129129

130130
self.assertEqual(get_session_id(), "test_session_id")
131-
uuid_mock.uuid4.assert_called_once()
131+
uuid_mock.assert_called_once()
132132
record_mock.assert_called()
133133
for i in range(record_mock.call_count):
134134
event = record_mock.call_args_list[i].args[0]
135135
self.assertEqual(event.session, "test_session_id")
136136

137-
@patch("torchx.util.session.uuid")
137+
@patch("torchx.util.session.uuid.uuid4")
138138
def test_run(self, uuid_mock: MagicMock, _) -> None:
139-
uuid_mock.uuid4.return_value = "test_session_id"
139+
uuid_mock.return_value = "test_session_id"
140140
test_file = self.tmpdir / "test_file"
141141

142142
with self.get_runner() as runner:

0 commit comments

Comments
 (0)