Skip to content

Commit

Permalink
Fix tholo#94 Get cache from disk to avoid cache overwriting.
Browse files Browse the repository at this point in the history
  • Loading branch information
iurisilvio committed Feb 4, 2023
1 parent d730278 commit 2cceb3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pytest_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ def pytest_collect_file(file_path, path, parent):

def pytest_unconfigure(config):
"""Flush cache at end of run."""
if hasattr(config, "_flake8mtimes"):
config.cache.set(HISTKEY, config._flake8mtimes)
if hasattr(config, "_flake8mtimes") and config._flake8mtimes:
cache = config.cache.get(HISTKEY, {})
cache.update(config._flake8mtimes)
config.cache.set(HISTKEY, cache)


class Flake8Error(Exception):
Expand Down

0 comments on commit 2cceb3b

Please sign in to comment.