Skip to content

Commit 5993c23

Browse files
committed
Use MagicMock consistently in test module
1 parent fda4f56 commit 5993c23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/instrument_server/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22
from typing import Optional
3-
from unittest.mock import ANY, MagicMock, Mock, patch
3+
from unittest.mock import ANY, MagicMock, patch
44
from urllib.parse import urlparse
55

66
import pytest
@@ -128,12 +128,12 @@ def test_upload_gain_reference(
128128
mock_machine_config["rsync_url"] = rsync_url_setting
129129

130130
# Assign expected values to the mock objects
131-
mock_response = Mock()
131+
mock_response = MagicMock()
132132
mock_response.status_code = 200
133133
mock_response.json.return_value = mock_machine_config
134134
mock_request.get.return_value = mock_response
135135
mock_get_server_url.return_value = server_url
136-
mock_subprocess.run.return_value = Mock(returncode=0)
136+
mock_subprocess.run.return_value = MagicMock(returncode=0)
137137

138138
# Construct payload and pass request to function
139139
gain_ref_file = f"{gain_ref_dir}/gain.mrc"

0 commit comments

Comments
 (0)