GeezerVison is showing github.com — Cleaned up mocks · googleapis/python-aiplatform@b09cece
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: samples/model-builder/conftest.py +6-3Lines changed: 6 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -215,7 +215,7 @@ def mock_run_custom_training_job(): |
215 | 215 |
|
216 | 216 | @pytest.fixture |
217 | 217 | def mock_model(): |
218 | | - mock = MagicMock(aiplatform.models.Model) |
| 218 | + mock = MagicMock(aiplatform.Model) |
219 | 219 | yield mock |
220 | 220 |
|
221 | 221 |
|
@@ -231,11 +231,13 @@ def mock_batch_predict_model(mock_model): |
231 | 231 | with patch.object(mock_model, "batch_predict") as mock: |
232 | 232 | yield mock |
233 | 233 |
|
| 234 | + |
234 | 235 | @pytest.fixture |
235 | 236 | def mock_upload_model(): |
236 | 237 | with patch.object(aiplatform.Model, "upload") as mock: |
237 | 238 | yield mock |
238 | 239 |
|
| 240 | + |
239 | 241 | @pytest.fixture |
240 | 242 | def mock_deploy_model(mock_model, mock_endpoint): |
241 | 243 | with patch.object(mock_model, "deploy") as mock: |
@@ -265,7 +267,7 @@ def mock_create_batch_prediction_job(): |
265 | 267 |
|
266 | 268 | @pytest.fixture |
267 | 269 | def mock_endpoint(): |
268 | | - mock = MagicMock(aiplatform.models.Endpoint) |
| 270 | + mock = MagicMock(aiplatform.Endpoint) |
269 | 271 | yield mock |
270 | 272 |
|
271 | 273 |
|
@@ -281,8 +283,9 @@ def mock_get_endpoint(mock_endpoint): |
281 | 283 | mock_get_endpoint.return_value = mock_endpoint |
282 | 284 | yield mock_get_endpoint |
283 | 285 |
|
| 286 | + |
284 | 287 | @pytest.fixture |
285 | 288 | def mock_endpoint_explain(mock_endpoint): |
286 | 289 | with patch.object(mock_endpoint, "explain") as mock_endpoint_explain: |
287 | 290 | mock_get_endpoint.return_value = mock_endpoint |
288 | | - yield mock_endpoint_explain |
| 291 | + yield mock_endpoint_explain |