MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_after_max_runtime

Function test_after_max_runtime

tests/stop/test_MaxRuntime.py:38–48  ·  view source on GitHub ↗

Tests that after the max runtime has passed, ``MaxRuntime`` stops.

(max_runtime)

Source from the content-addressed store, hash-verified

36
37@mark.parametrize("max_runtime", [0.01, 0.05, 0.10])
38def test_after_max_runtime(max_runtime):
39 """
40 Tests that after the max runtime has passed, ``MaxRuntime`` stops.
41 """
42 stop = MaxRuntime(max_runtime)
43 assert_(not stop(1)) # trigger the first time measurement
44
45 sleep(max_runtime)
46
47 for _ in range(100):
48 assert_(stop(1))

Callers

nothing calls this directly

Calls 2

MaxRuntimeClass · 0.90
sleepFunction · 0.90

Tested by

no test coverage detected