Skip to content

Commit

Permalink
Make sure the file gets closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
itamarst committed May 24, 2022
1 parent 32d0cb6 commit e778b43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/unit/test_network_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def test_cache_roundtrip_body(self, cache_tmpdir: Path) -> None:
cache.set_body("test key", b"a test string")
body = cache.get_body("test key")
assert body is not None
assert body.read() == b"a test string"
with body:
assert body.read() == b"a test string"
cache.delete("test key")
assert cache.get_body("test key") is None

Expand Down

0 comments on commit e778b43

Please sign in to comment.