frozen time

Making the current time a fixed value during a test, by passing an instant in or patching the clock.

In more detail

With the clock held still you can check both sides of a boundary, such as one second before expiry and exactly at expiry, with no sleeping and no race. Libraries such as time-machine and freezegun patch the clock globally; a parameter is narrower.

Related terms

Taught in

References