Test that _yield_comparisons yields (actual, expected) pairs.
(self)
| 1360 | assert "string" != approx(datetime(2024, 1, 1), abs=timedelta(seconds=1)) |
| 1361 | |
| 1362 | def test_yield_comparisons(self): |
| 1363 | """Test that _yield_comparisons yields (actual, expected) pairs.""" |
| 1364 | from datetime import datetime |
| 1365 | from datetime import timedelta |
| 1366 | |
| 1367 | dt = datetime(2024, 1, 1, 12, 0, 0) |
| 1368 | a = approx(dt, abs=timedelta(seconds=1)) |
| 1369 | actual = datetime(2024, 1, 1, 12, 0, 0, 500000) |
| 1370 | pairs = list(a._yield_comparisons(actual)) |
| 1371 | assert pairs == [(actual, dt)] |
| 1372 | |
| 1373 | def test_repr_compare_with_incompatible_type(self): |
| 1374 | """_repr_compare handles TypeError when actual is not a datetime.""" |
nothing calls this directly
no test coverage detected