mciepluc / cocotb-coverage

Functional Coverage and Constrained Randomization Extensions for Cocotb
BSD 2-Clause "Simplified" License
100 stars 15 forks source link

Always close file descriptor #53

Closed imphil closed 2 years ago

imphil commented 2 years ago

Running the test suite reports that a file descriptor isn't closed.

tests/test_coverage/coverage_test.py:274: ResourceWarning: unclosed file <_io.TextIOWrapper name='test_yaml_export_output.yml' mode='r' encoding='UTF-8'>
    yml_db = yaml.safe_load(open(yml_filename, 'r'))

Ensure the file is closed by using a context manager.

mciepluc commented 2 years ago

Thanks @imphil You want a new release with this change?

imphil commented 2 years ago

Oh no, no need for an immediate release. (I also have a couple other fixes upcoming.)