twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
362 stars 74 forks source link

`regiontests.py` raises an unclosed file warning #126

Open s-leroux opened 5 years ago

s-leroux commented 5 years ago

Unit tests raise a warning regarding an unclosed file while running regiontests.py. Not sure if this signals a bug in the library, or if a call to close() is simply missing somewhere in the test case.

sh$ python3 --version
Python 3.5.3

sh$ python3 -m unittest regiontests.py 
.............................................s....................ss/usr/lib/python3.5/unittest/case.py:601: ResourceWarning: unclosed file <_io.BufferedRandom name='/tmp/tmp8g4jp6pt/regiontest.mca'>
  testMethod()
s./usr/lib/python3.5/unittest/case.py:601: ResourceWarning: unclosed file <_io.BufferedRandom name='/tmp/tmpx42vqwfp/regiontest_obj.mca'>
  testMethod()
s....
----------------------------------------------------------------------
Ran 75 tests in 1.320s

OK (skipped=5)