Fix ResourceWarning that occur during tests
Fix ResourceWarning that occur during tests

Appear as:

  ResourceWarning: unclosed file ...

Always close a file explicitly. Use a context manager to make this
simpler.

mitsuhiko/click,pallets/click