Skip to main content

Bust functools.lru_cache when running pytest to avoid test pollution

Project description

Caching with functools.lru_cache is great for performance. It works so well that it’ll even speed up your unit test runs. All you need to sacrifice in return is test isolation and your sanity.

Imagine, you mock some things out and a function caches those results. On your next test run, it doesn’t matter what you mock, the results are already cached. Now trying running those two test out-of-order sequence and tell me how it goes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-antilru-0.2.0.linux-x86_64.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distributions

pytest_antilru-0.2.0-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

pytest_antilru-0.2.0-py2-none-any.whl (4.0 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page