Parcourir la source

Fix 2 unclosed files in test_dispatchers.py

Fixes 2 of the `ResourceWarning` warnings in GH-391.
Marc Abramowitz il y a 11 ans
Parent
commit
6a87f5eeae
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      supervisor/tests/test_dispatchers.py

+ 4 - 0
supervisor/tests/test_dispatchers.py

@@ -289,6 +289,8 @@ class POutputDispatcherTests(unittest.TestCase):
 
         finally:
             try:
+                dispatcher.capturelog.close()
+                dispatcher.childlog.close()
                 os.remove(logfile)
             except (OSError, IOError):
                 pass
@@ -353,6 +355,8 @@ class POutputDispatcherTests(unittest.TestCase):
 
         finally:
             try:
+                dispatcher.capturelog.close()
+                dispatcher.childlog.close()
                 os.remove(logfile)
             except (OSError, IOError):
                 pass