mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Ensure that a file is closed in the tests
This commit is contained in:
parent
69a4f383f6
commit
92dbf34286
3
tests/fixtures/tests.py
vendored
3
tests/fixtures/tests.py
vendored
@ -52,7 +52,8 @@ class DumpDataAssertMixin(object):
|
||||
'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()
|
||||
|
Loading…
Reference in New Issue
Block a user