Przeglądaj źródła

Fix 2 unclosed files in test_dispatchers.py

Fixes 2 of the `ResourceWarning` warnings in GH-391.
Marc Abramowitz 11 lat temu
rodzic
commit
af5c82be21
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      supervisor/tests/test_dispatchers.py

+ 4 - 0
supervisor/tests/test_dispatchers.py

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