Skip to content

Commit c287f51

Browse files
authored
Fix warning in openslide test (#1009)
``` ResourceWarning: unclosed file <_io.BufferedReader name='/input/tests/data/test.tif'> testMethod() ResourceWarning: Enable tracemalloc to get the object allocation traceback ```
1 parent 7f983e2 commit c287f51

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/test_openslide.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44

55
class TestOpenslide(unittest.TestCase):
66
def test_read_tif(self):
7-
slide = open_slide('/input/tests/data/test.tif')
8-
9-
self.assertEqual(1, slide.level_count)
7+
with open_slide('/input/tests/data/test.tif') as slide:
8+
self.assertEqual(1, slide.level_count)

0 commit comments

Comments
 (0)