|
7 | 7 | import re |
8 | 8 | import os |
9 | 9 | import time |
10 | | -import uuid |
11 | 10 | from packaging.version import Version |
12 | 11 | from unittest import mock |
13 | 12 |
|
14 | 13 | import pytest |
| 14 | +import requests |
15 | 15 | import scipy.stats |
16 | 16 | import sklearn |
17 | 17 | import sklearn.datasets |
|
31 | 31 | import openml |
32 | 32 | import openml.exceptions |
33 | 33 | import openml.utils |
34 | | -import requests |
35 | | -from openml.testing import SimpleImputer, TestBase, create_request_response |
| 34 | + |
| 35 | +from openml.testing import SimpleImputer, TestBase |
36 | 36 |
|
37 | 37 |
|
38 | 38 | class TestFlow(TestBase): |
@@ -117,7 +117,7 @@ def test_tagging(self): |
117 | 117 | flow.push_tag(tag) |
118 | 118 | flows = openml.flows.list_flows(tag=tag) |
119 | 119 | assert len(flows) == 1 |
120 | | - assert flow_id in flows["id"].values |
| 120 | + assert flow_id in flows["id"] |
121 | 121 | flow.remove_tag(tag) |
122 | 122 | flows = openml.flows.list_flows(tag=tag) |
123 | 123 | assert len(flows) == 0 |
@@ -299,15 +299,14 @@ def test_semi_legal_flow(self): |
299 | 299 | TestBase._mark_entity_for_removal("flow", flow.flow_id, flow.name) |
300 | 300 | TestBase.logger.info(f"collected from {__file__.split('/')[-1]}: {flow.flow_id}") |
301 | 301 |
|
302 | | - |
303 | 302 | @pytest.mark.sklearn() |
304 | 303 | @mock.patch("openml.flows.functions.get_flow") |
305 | 304 | @mock.patch("openml.flows.functions.flow_exists") |
306 | 305 | @mock.patch("requests.Session.request") |
307 | 306 | def test_publish_error(self, mock_request, flow_exists_mock, get_flow_mock): |
308 | 307 | model = sklearn.ensemble.RandomForestClassifier() |
309 | 308 | flow = self.extension.model_to_flow(model) |
310 | | - |
| 309 | + |
311 | 310 | # Create mock response directly |
312 | 311 | response = requests.Response() |
313 | 312 | response.status_code = 200 |
|
0 commit comments