use pytestconfig cache in pytest code example Example: pytest run only failed test pytest --last-failed