Skip to content

Conversation

@petedmarsh
Copy link
Contributor

freezegun is a Python library used to set the date/time returned by
the Python date/time functions to make testing time-sensitive code
easier.

time.time() is used here to measure the duration of test cases, if
freezegun was in use then the time returned by this could be the
time the test had set up, rather than the actual time. This lead to
test durations being reported as negative (if frozen time is in the
past), or much longer than expected (if fronzen time is in the
future).

freezegun exposes the unmodified time.time() via an alias. This
changes TimingSuite so that it uses this alias if freezegun is
installed.

@coveralls
Copy link

coveralls commented Jun 16, 2017

Coverage Status

Coverage decreased (-0.9%) to 65.278% when pulling 36f041b on petedmarsh:master into dee5dfd on realpython:master.

freezegun is a Python library used to set the date/time returned by
the Python date/time functions to make testing time-sensitive code
easier.

time.time() is used here to measure the duration of test cases, if
freezegun was in use then the time returned by this could be the
time the test had set up, rather than the actual time. This lead to
test durations being reported as negative (if frozen time is in the
past), or much longer than expected (if fronzen time is in the
future).

freezegun exposes the unmodified time.time() via an alias. This
changes TimingSuite so that it uses this alias if freezegun is
installed.
@coveralls
Copy link

coveralls commented Jun 16, 2017

Coverage Status

Coverage remained the same at 66.154% when pulling 91202a6 on petedmarsh:master into dee5dfd on realpython:master.

@coveralls
Copy link

coveralls commented Jun 16, 2017

Coverage Status

Coverage remained the same at 66.154% when pulling 91202a6 on petedmarsh:master into dee5dfd on realpython:master.

@mjhea0 mjhea0 merged commit fd5f507 into realpython:master Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants