Sfoglia il codice sorgente

Fix 2 unclosed files in test_dispatchers.py

Fixes 2 of the `ResourceWarning` warnings in GH-391.
Marc Abramowitz 11 anni fa
parent
commit
af5c82be21
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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