mirror of
https://github.com/django/django.git
synced 2025-07-23 21:25:40 +00:00
Refs #23658 -- Fixed unclosed file in dbshell tests.
This commit is contained in:
parent
b44dee16e6
commit
b535eb3fcb
1 changed files with 2 additions and 1 deletions
|
@ -23,7 +23,8 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
|
||||||
def _mock_subprocess_call(*args):
|
def _mock_subprocess_call(*args):
|
||||||
self.subprocess_args = list(*args)
|
self.subprocess_args = list(*args)
|
||||||
if 'PGPASSFILE' in os.environ:
|
if 'PGPASSFILE' in os.environ:
|
||||||
self.pgpass = open(os.environ['PGPASSFILE'], 'rb').read()
|
with open(os.environ['PGPASSFILE'], 'rb') as f:
|
||||||
|
self.pgpass = f.read()
|
||||||
else:
|
else:
|
||||||
self.pgpass = None
|
self.pgpass = None
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue