(self)
| 534 | assert approx(x, rel=5e-7, abs=0) != a |
| 535 | |
| 536 | def test_complex(self): |
| 537 | within_1e6 = [ |
| 538 | (1.000001 + 1.0j, 1.0 + 1.0j), |
| 539 | (1.0 + 1.000001j, 1.0 + 1.0j), |
| 540 | (-1.000001 + 1.0j, -1.0 + 1.0j), |
| 541 | (1.0 - 1.000001j, 1.0 - 1.0j), |
| 542 | ] |
| 543 | for a, x in within_1e6: |
| 544 | assert a == approx(x, rel=5e-6, abs=0) |
| 545 | assert a != approx(x, rel=5e-7, abs=0) |
| 546 | assert approx(x, rel=5e-6, abs=0) == a |
| 547 | assert approx(x, rel=5e-7, abs=0) != a |
| 548 | |
| 549 | def test_list(self): |
| 550 | actual = [1 + 1e-7, 2 + 1e-8] |