Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Explicitly close files in the staticfiles tests.

  • Loading branch information...
commit 2048bbee8c17495d5156d40073715cb9d7511c5a 1 parent 20a7a24
@alex alex authored Alex Gaynor committed
Showing with 2 additions and 3 deletions.
  1. +2 −3 tests/regressiontests/staticfiles_tests/tests.py
View
5 tests/regressiontests/staticfiles_tests/tests.py
@@ -197,9 +197,8 @@ def _get_file(self, filepath):
call_command('findstatic', filepath, all=False, verbosity=0, stdout=out)
out.seek(0)
lines = [l.strip() for l in out.readlines()]
- contents = codecs.open(
- smart_text(lines[1].strip()), "r", "utf-8").read()
- return contents
+ with codecs.open(smart_text(lines[1].strip()), "r", "utf-8") as f:
+ return f.read()
def test_all_files(self):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.