Skip to content

Commit df7f3ca

Browse files
author
James William Pye
committed
use with statement
1 parent 4f4eb4f commit df7f3ca

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

postgresql/test/test_driver.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,10 +1730,8 @@ def testBadFD(self):
17301730

17311731
@pg_tmp
17321732
def testAdminTerminated(self):
1733-
killer = new()
1734-
killer.sys.terminate_backends()
1735-
# hoping that this will guarantee that the terminate is complete
1736-
killer.close()
1733+
with new() as killer:
1734+
killer.sys.terminate_backends()
17371735

17381736
self.assertRaises(
17391737
pg_exc.AdminShutdownError,

0 commit comments

Comments
 (0)