From b6ccfb45c88e50b4127ea3f06da767ee416b9d0d Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 8 Nov 2017 17:19:52 -0600 Subject: [PATCH] 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. --- tests/unit/utils/test_verify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/utils/test_verify.py b/tests/unit/utils/test_verify.py index f4d0638178..f0de8605bc 100644 --- a/tests/unit/utils/test_verify.py +++ b/tests/unit/utils/test_verify.py @@ -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):