def pytest_sessionfinish(self, session):
    config = self.config
    if (config.getoption('cacheshow') or hasattr(config, 'slaveinput')):
        return
    saved_lastfailed = config.cache.get('cache/lastfailed', {})
    if (saved_lastfailed != self.lastfailed):
        config.cache.set('cache/lastfailed', self.lastfailed)
def pytest_sessionfinish(self, session):
    config = self.config
    if (config.getoption('cacheshow') or hasattr(config, 'slaveinput')):
        return
    saved_lastfailed = config.cache.get('cache/lastfailed', {})
    if (saved_lastfailed != self.lastfailed):
        config.cache.set('cache/lastfailed', self.lastfailed)