Skip to content

Commit

Permalink
Get cache from disk to avoid cache overwriting.
Browse files Browse the repository at this point in the history
  • Loading branch information
iurisilvio authored Feb 20, 2023
1 parent 1d0d34a commit 64ad0f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytest_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def pytest_configure(config):
def pytest_unconfigure(config):
# save cached mtimes at end of session
if hasattr(config, "_blackmtimes"):
config.cache.set(HISTKEY, config._blackmtimes)
cache = config.cache.get(HISTKEY, {})
cache.update(config._blackmtimes)
config.cache.set(HISTKEY, cache)


class BlackItem(pytest.Item, pytest.File):
Expand Down

0 comments on commit 64ad0f6

Please sign in to comment.