Skip to content

Commit 623f33a

Browse files
committed
fix: Release reader from memory and typo
1 parent 6f51e55 commit 623f33a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_unit_tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ def test_stream_read_and_parse(self):
5555
self.assertEqual(title, "C.jpg")
5656

5757
def test_stream_read_string_stream(self):
58-
reader = Reader("image/jpeg", self.testPath)
59-
json_data = reader.json()
60-
self.assertIn("C.jpg", json_data)
58+
with Reader("image/jpeg", self.testPath) as reader:
59+
json_data = reader.json()
60+
self.assertIn("C.jpg", json_data)
6161

6262
def test_stream_read_string_stream_and_parse(self):
63-
reader = Reader("image/jpeg", self.testPath)
64-
manifest_store = json.loads(reader.json())
65-
title = manifest_store["manifests"][manifest_store["active_manifest"]]["title"]
66-
self.assertEqual(title, "C.jpg")
63+
with Reader("image/jpeg", self.testPath) as reader:
64+
manifest_store = json.loads(reader.json())
65+
title = manifest_store["manifests"][manifest_store["active_manifest"]]["title"]
66+
self.assertEqual(title, "C.jpg")
6767

6868
def test_reader_bad_format(self):
6969
with self.assertRaises(Error.NotSupported):
@@ -429,7 +429,7 @@ def test_builder_sign_with_ingredient(self):
429429

430430
builder.close()
431431

432-
def test_builder_sign_with__duplicate_ingredient(self):
432+
def test_builder_sign_with_duplicate_ingredient(self):
433433
"""Test Builder class operations with a real file."""
434434
# Test creating builder from JSON
435435

0 commit comments

Comments
 (0)