|
19 | 19 | case.assertAlmostEqual(2.4, 2.41) |
20 | 20 | case.assertAlmostEqual(Fraction(49, 50), Fraction(48, 50)) |
21 | 21 | case.assertAlmostEqual(3.14, complex(5, 6)) |
| 22 | +case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) |
22 | 23 | case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), delta=timedelta(hours=1)) |
23 | 24 | case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), None, "foo", timedelta(hours=1)) |
24 | 25 | case.assertAlmostEqual(Decimal("1.1"), Decimal("1.11")) |
|
28 | 29 |
|
29 | 30 | case.assertAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore |
30 | 31 | case.assertAlmostEqual("foo", "bar") # type: ignore |
31 | | -case.assertAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) |
32 | 32 | case.assertAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore |
33 | 33 | case.assertAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore |
34 | 34 |
|
|
39 | 39 | case.assertAlmostEqual(1, 2.4) |
40 | 40 | case.assertNotAlmostEqual(Fraction(49, 50), Fraction(48, 50)) |
41 | 41 | case.assertAlmostEqual(3.14, complex(5, 6)) |
| 42 | +case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) |
42 | 43 | case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), delta=timedelta(hours=1)) |
43 | 44 | case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1), None, "foo", timedelta(hours=1)) |
44 | 45 |
|
45 | 46 | case.assertNotAlmostEqual(2.4, 2.41, places=9, delta=0.02) # type: ignore |
46 | 47 | case.assertNotAlmostEqual("foo", "bar") # type: ignore |
47 | | -case.assertNotAlmostEqual(datetime(1999, 1, 2), datetime(1999, 1, 2, microsecond=1)) |
48 | 48 | case.assertNotAlmostEqual(Decimal("0.4"), Fraction(1, 2)) # type: ignore |
49 | 49 | case.assertNotAlmostEqual(complex(2, 3), Decimal("0.9")) # type: ignore |
50 | 50 |
|
|
0 commit comments