Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure that a file is closed in the tests

  • Loading branch information...
commit 92dbf342868e68dfe60569c60dd5aa5925194221 1 parent 69a4f38
@alex alex authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  tests/fixtures/tests.py
View
3  tests/fixtures/tests.py
@@ -52,7 +52,8 @@ def _dumpdata_assert(self, args, output, format='json', filename=None,
'exclude': exclude_list,
'primary_keys': primary_keys})
if filename:
- command_output = open(filename, "r").read()
+ with open(filename, "r") as f:
+ command_output = f.read()
os.remove(filename)
else:
command_output = new_io.getvalue().strip()
Please sign in to comment.
Something went wrong with that request. Please try again.