(self)
| 2445 | assert_(not np.allclose(x, y), "%s and %s shouldn't be close" % (x, y)) |
| 2446 | |
| 2447 | def test_ip_allclose(self): |
| 2448 | # Parametric test factory. |
| 2449 | arr = np.array([100, 1000]) |
| 2450 | aran = np.arange(125).reshape((5, 5, 5)) |
| 2451 | |
| 2452 | atol = self.atol |
| 2453 | rtol = self.rtol |
| 2454 | |
| 2455 | data = [([1, 0], [1, 0]), |
| 2456 | ([atol], [0]), |
| 2457 | ([1], [1+rtol+atol]), |
| 2458 | (arr, arr + arr*rtol), |
| 2459 | (arr, arr + arr*rtol + atol*2), |
| 2460 | (aran, aran + aran*rtol), |
| 2461 | (np.inf, np.inf), |
| 2462 | (np.inf, [np.inf])] |
| 2463 | |
| 2464 | for (x, y) in data: |
| 2465 | self.tst_allclose(x, y) |
| 2466 | |
| 2467 | def test_ip_not_allclose(self): |
| 2468 | # Parametric test factory. |
nothing calls this directly
no test coverage detected