(self, a, b)
| 262 | self.assertAlmostEqual(a_value, b_value, msg=f"{a_name}") |
| 263 | |
| 264 | def assertNestedEqual(self, a, b): |
| 265 | a_kv = flatten_items(a) |
| 266 | b_kv = flatten_items(b) |
| 267 | self.assertCountEqual([k for k, _ in a_kv], [k for k, _ in b_kv]) |
| 268 | a_dict = dict(a_kv) |
| 269 | b_dict = dict(b_kv) |
| 270 | for k in a_dict: |
| 271 | a_value = a_dict[k] |
| 272 | b_value = b_dict[k] |
| 273 | np.testing.assert_array_equal(a_value, b_value, err_msg=k) |
| 274 | if hasattr(a_value, "dtype"): |
| 275 | self.assertEqual(a_value.dtype, b_value.dtype) |
| 276 | |
| 277 | def assertAllCloseWithOutliers(self, actual, desired, *, tolerance_map: dict[float, Tolerance]): |
| 278 | """Like np.testing.assert_allclose, but allows outlier percentiles to be specified. |
no test coverage detected