Skip to content

Commit

Permalink
Fix warning in openslide test (#1009)
Browse files Browse the repository at this point in the history
```
ResourceWarning: unclosed file <_io.BufferedReader name='/input/tests/data/test.tif'>
  testMethod()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
```
  • Loading branch information
rosbo committed May 7, 2021
1 parent 7f983e2 commit c287f51
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_openslide.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

class TestOpenslide(unittest.TestCase):
def test_read_tif(self):
slide = open_slide('/input/tests/data/test.tif')

self.assertEqual(1, slide.level_count)
with open_slide('/input/tests/data/test.tif') as slide:
self.assertEqual(1, slide.level_count)

0 comments on commit c287f51

Please sign in to comment.