(self)
| 547 | assert approx(x, rel=5e-7, abs=0) != a |
| 548 | |
| 549 | def test_list(self): |
| 550 | actual = [1 + 1e-7, 2 + 1e-8] |
| 551 | expected = [1, 2] |
| 552 | |
| 553 | # Return false if any element is outside the tolerance. |
| 554 | assert actual == approx(expected, rel=5e-7, abs=0) |
| 555 | assert actual != approx(expected, rel=5e-8, abs=0) |
| 556 | assert approx(expected, rel=5e-7, abs=0) == actual |
| 557 | assert approx(expected, rel=5e-8, abs=0) != actual |
| 558 | |
| 559 | def test_list_decimal(self): |
| 560 | actual = [Decimal("1.000001"), Decimal("2.000001")] |