MCPcopy Create free account
hub / github.com/python-arq/arq / test_next_cron_random

Function test_next_cron_random

tests/test_cron.py:138–145  ·  view source on GitHub ↗
(max_previous, kwargs, expected)

Source from the content-addressed store, hash-verified

136 ],
137)
138def test_next_cron_random(max_previous, kwargs, expected):
139 for i in range(100):
140 previous = expected - timedelta(seconds=0.9 + random() * max_previous)
141 v = next_cron(previous, **kwargs)
142 diff = v - previous
143 if diff > timedelta(seconds=1):
144 print(f'previous: {previous}, expected: {expected}, diff: {v - previous}')
145 assert v == expected
146
147
148async def foobar(ctx):

Callers

nothing calls this directly

Calls 1

next_cronFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…