django-wiki / django-nyt

Notification system for Django with batteries included: Email digests, user settings, JSON API
Apache License 2.0
144 stars 47 forks source link

Use context manager for open file #96

Closed ad-m closed 4 years ago

ad-m commented 4 years ago

Context managers is modern - I suppose the code was written before this support was added in Python, but we now support Python 3, so we're safe. Context managers is safe - all resources are always released. Context managers is clear - the intention is simpler to grasp, the code is more "pythonic"

codecov-io commented 4 years ago

Codecov Report

Merging #96 into master will decrease coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
- Coverage   76.21%   76.17%   -0.05%     
==========================================
  Files          26       26              
  Lines         555      554       -1     
==========================================
- Hits          423      422       -1     
  Misses        132      132
Impacted Files Coverage Δ
django_nyt/management/commands/notifymail.py 73.43% <100%> (-0.21%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6598edc...f0cb468. Read the comment docs.

benjaoming commented 4 years ago

Thanks for that nice little positive update :)