Closed ramji-c closed 3 years ago
load_test() doesn't have a file close operation when loading a test suite from file, which raises this warning
load_test()
/Users/rchandrasekara/repos/checklist/checklist/abstract_test.py:12: ResourceWarning: unclosed file <_io.BufferedReader name='guardrail/behavioral_test/serialized/trial'> return dill.load(open(file, 'rb')) ResourceWarning: Enable tracemalloc to get the object allocation traceback
So, I have wrapped the dill.load() line inside a with clause to safely close the file after opening.
dill.load()
with
load_test()
doesn't have a file close operation when loading a test suite from file, which raises this warningSo, I have wrapped the
dill.load()
line inside awith
clause to safely close the file after opening.