|
5 | 5 | import functools |
6 | 6 | import unittest |
7 | 7 | from collections import OrderedDict |
| 8 | +from multiprocessing.managers import Value |
| 9 | + |
8 | 10 | from packaging.version import Version |
9 | 11 | from unittest import mock |
10 | 12 | from unittest.mock import patch |
@@ -195,27 +197,17 @@ def test_are_flows_equal_ignore_parameter_values(self): |
195 | 197 |
|
196 | 198 | new_flow = copy.deepcopy(flow) |
197 | 199 | new_flow.parameters["a"] = 7 |
198 | | - self.assertRaisesRegex( |
199 | | - ValueError, |
200 | | - r"values for attribute 'parameters' differ: " |
201 | | - r"'OrderedDict\(\[\('a', 5\), \('b', 6\)\]\)'\nvs\n" |
202 | | - r"'OrderedDict\(\[\('a', 7\), \('b', 6\)\]\)'", |
203 | | - openml.flows.functions.assert_flows_equal, |
204 | | - flow, |
205 | | - new_flow, |
206 | | - ) |
| 200 | + with pytest.raises(ValueError) as excinfo: |
| 201 | + openml.flows.functions.assert_flows_equal(flow, new_flow) |
| 202 | + assert str(paramaters) in str(excinfo.value) and str(new_flow.parameters) in str(excinfo.value) |
| 203 | + |
207 | 204 | openml.flows.functions.assert_flows_equal(flow, new_flow, ignore_parameter_values=True) |
208 | 205 |
|
209 | 206 | del new_flow.parameters["a"] |
210 | | - self.assertRaisesRegex( |
211 | | - ValueError, |
212 | | - r"values for attribute 'parameters' differ: " |
213 | | - r"'OrderedDict\(\[\('a', 5\), \('b', 6\)\]\)'\nvs\n" |
214 | | - r"'OrderedDict\(\[\('b', 6\)\]\)'", |
215 | | - openml.flows.functions.assert_flows_equal, |
216 | | - flow, |
217 | | - new_flow, |
218 | | - ) |
| 207 | + with pytest.raises(ValueError) as excinfo: |
| 208 | + openml.flows.functions.assert_flows_equal(flow, new_flow) |
| 209 | + assert str(paramaters) in str(excinfo.value) and str(new_flow.parameters) in str(excinfo.value) |
| 210 | + |
219 | 211 | self.assertRaisesRegex( |
220 | 212 | ValueError, |
221 | 213 | r"Flow Test: parameter set of flow differs from the parameters " |
|
0 commit comments