{"library":"pytest-cache","title":"pytest-cache","description":"pytest-cache was an external plugin for pytest that provided mechanisms for caching data across test runs, including options to re-run only last failed tests (`--lf`) or run failed tests first (`--ff`), and a `config.cache` object for plugins to store and retrieve values. Its core functionality was integrated into pytest itself starting around versions 2.8 and 3.8. The last release of the standalone `pytest-cache` plugin was version 1.0 in June 2013, making it effectively abandoned as its features are now part of `pytest` core.","language":"python","status":"abandoned","last_verified":"Tue Apr 14","install":{"commands":["pip install pytest-cache"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# The functionality of pytest-cache is now built into pytest.\n# To access the cache in modern pytest:\n\ndef test_example_with_cache(cache):\n    # Get a value from the cache, with a default if not found\n    cached_value = cache.get('myplugin/some_key', 'default_value')\n    print(f\"Cached value: {cached_value}\")\n\n    # Set a value in the cache\n    cache.set('myplugin/some_key', 'new_value')\n\n# To run only last failed tests:\n# pytest --lf\n\n# To run failed tests first, then the rest:\n# pytest --ff\n\n# To clear the cache:\n# pytest --cache-clear","lang":"python","description":"This quickstart demonstrates how to use the caching mechanisms directly provided by modern pytest, which supersede the `pytest-cache` plugin. It shows how to access the `cache` fixture, and common command-line options for test re-running and cache management.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}