{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"Clears functools.lru_cache between pytest test runs to prevent test pollution from cached values persisting across tests.","skillfed_tags":["pytest-plugin","test-isolation","cache-management"],"use_cases":["Testing functions that use lru_cache with mocked network calls or external dependencies that return different values across test cases.","Ensuring test order independence when cached functions are involved, preventing flaky tests that pass or fail based on execution sequence.","Selectively disabling cache for specific modules while preserving it in others to avoid breaking dependencies that rely on caching.","Debugging test pollution issues caused by persistent cached state from previous test runs."],"what_it_does":"pytest-antilru is a pytest plugin that automatically clears functools.lru_cache between test runs. When you use lru_cache in your application code and then mock or patch dependencies in tests, the cache can retain stale values from previous test runs, causing tests to fail or pass unexpectedly depending on execution order. This plugin solves that by busting the cache between tests, restoring proper test isolation.\n\nThe plugin works automatically once installed\u2014no code changes needed. By default it disables lru_cache everywhere, but you can configure an allowlist of specific module paths where caching should remain active, useful when other dependencies rely on cache behavior to function correctly within a single test run.","worth_installing":"Yes. This is a targeted fix for a real problem\u2014test pollution from lru_cache\u2014with low install friction, active maintenance, no vulnerabilities, and permissive licensing. If you use lru_cache in code under test and have experienced test ordering issues or mocking problems, this plugin eliminates the problem with zero code changes."},"id":"pytest-antilru","links":{"html":"https://skillfed.io/packages/pytest-antilru","md":"https://skillfed.io/packages/pytest-antilru.md","pypi":"https://pypi.org/project/pytest-antilru/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-03","license_spdx":"MIT","license_treatment":"permissive","name":"pytest-antilru","python_support":"supports_current","summary":"Bust functools.lru_cache when running pytest to avoid test pollution"},"popularity":{"monthly_downloads":239801,"position":8915,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.0.1"}
