Ver Fonte

Fix 2 unclosed files in test_dispatchers.py

Fixes 2 of the `ResourceWarning` warnings in GH-391.
Marc Abramowitz há 11 anos atrás
pai
commit
6a87f5eeae
1 ficheiros alterados com 4 adições e 0 exclusões
  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