Skip to content

Commit

Permalink
Ignore unserializable objects when json dumping in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Sep 22, 2024
1 parent 090cdd2 commit 0b1dd70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ async def cache():

os.makedirs(".pytest_cache", exist_ok=True)
with open(".pytest_cache/hoyo_cache.json", "w", encoding="utf-8") as file:
json.dump(cache, file, indent=4, ensure_ascii=False)
try:
json.dump(cache, file, indent=4, ensure_ascii=False)
except TypeError:
# Some objects are not serializable
pass


@pytest.fixture(scope="session")
Expand Down

0 comments on commit 0b1dd70

Please sign in to comment.