simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.58k stars 106 forks source link

Use context managers for file writes in tests #618

Closed kbaikov closed 4 months ago

kbaikov commented 4 months ago

This removes the need to explicitly close files and avoids accidental unclosed files


📚 Documentation preview 📚: https://sqlite-utils--618.org.readthedocs.build/en/618/

simonw commented 4 months ago

Thanks, this is neater.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.69%. Comparing base (17eb818) to head (2fc480a). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #618 +/- ## ======================================= Coverage 95.69% 95.69% ======================================= Files 8 8 Lines 2854 2854 ======================================= Hits 2731 2731 Misses 123 123 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.