MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / test_closest

Function test_closest

tests/date/test_comparison.py:174–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172
173
174def test_closest():
175 instance = pendulum.Date(2015, 5, 28)
176 dt1 = pendulum.Date(2015, 5, 27)
177 dt2 = pendulum.Date(2015, 5, 30)
178 closest = instance.closest(dt1, dt2)
179 assert closest == dt1
180
181 closest = instance.closest(dt2, dt1)
182 assert closest == dt1
183
184
185def test_closest_with_date():

Callers

nothing calls this directly

Calls 1

closestMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…