Explorar o código

Cleanup all open files

If the fd is not closed the cleanup will fail on windows.

Signed-off-by: Djordje Lukic <[email protected]>
Djordje Lukic %!s(int64=6) %!d(string=hai) anos
pai
achega
f8142a899c
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      tests/unit/project_test.py

+ 2 - 1
tests/unit/project_test.py

@@ -880,7 +880,8 @@ class ProjectTest(unittest.TestCase):
         service = 'foo'
         secret_source = 'bar'
 
-        _, filename_path = tempfile.mkstemp()
+        fd, filename_path = tempfile.mkstemp()
+        os.close(fd)
         self.addCleanup(os.remove, filename_path)
 
         def mock_get(key):