tests: ensure file is closed in connection_test.

issue510
David Wilson 6 years ago
parent 73979043ad
commit eb93f82d05

@ -96,7 +96,11 @@ class PutFileTest(ConnectionMixin, unittest2.TestCase):
def setUpClass(cls): def setUpClass(cls):
super(PutFileTest, cls).setUpClass() super(PutFileTest, cls).setUpClass()
cls.big_path = tempfile.mktemp(prefix='mitotestbig') cls.big_path = tempfile.mktemp(prefix='mitotestbig')
open(cls.big_path, 'w').write('x'*1048576) fp = open(cls.big_path, 'w')
try:
fp.write('x'*1048576)
finally:
fp.close()
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):

Loading…
Cancel
Save