Wait until after restoring original resource limit before removing temp files

Invoking shutil.rmtree() first was causing a traceback since the max
open files setting was still set very low for the test. This moves the
shutil.rmtree() until after we have restored the original resource
limit.
This commit is contained in:
Erik Johnson 2017-11-08 17:19:52 -06:00
parent 4eb248b129
commit b6ccfb45c8
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -250,11 +250,11 @@ class TestVerify(TestCase):
self.skipTest('We\'ve hit the max open files setting')
raise
finally:
shutil.rmtree(tempdir)
if sys.platform.startswith('win'):
win32file._setmaxstdio(mof_h)
else:
resource.setrlimit(resource.RLIMIT_NOFILE, (mof_s, mof_h))
shutil.rmtree(tempdir)
@skipIf(NO_MOCK, NO_MOCK_REASON)
def test_verify_log(self):