Skip to main content

fakesleep is a simple module for tests that use time.sleep(). Sleeping in tests is generally considered bad (as it makes tests run slow). Using sleep with time.time() can lead to spurious failures, as clock precision / interpeter overhead can cause small differences in reported times.

But sometimes, you need sleep().

fakesleep provides a fake implementation of time.sleep() that doesn’t actually sleep. It also guarrantees “correct” results for calls to time.time() and other time functions. Note that datetime functions are not faked.

To install, simply call fakesleep.monkey_patch(). To restore the real versions, call fakesleep.monkey_restore().

author:

Pete Fein <pete@wearpants.org>

license:

BSD

versions:

Python 2.7 & 3

source:

https://github.com/wearpants/fakesleep

Metadata

Release files for fakesleep 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fakesleep 0.1
File Size Uploaded Provenance Actions
fakesleep-0.1.tar.gz 8.2 kB Without provenance Details for fakesleep-0.1.tar.gz

Release files / fakesleep-0.1.tar.gz

Download URL fakesleep-0.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c577e2183207bf5f509b4f06100cd4722660300f9953e396d730727937bdfc41
BLAKE2b-256 checksum
How to use checksums
df91e0036831c41ceb08a7c7887b9da348acf66b85d00d91227dab18bb51f56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fakesleep 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page