Skip to content

Commit c13179d

Browse files
committed
Fix ResourceWarning from new syslog tests
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed file <_io.BufferedWriter name='/tmp/foo'> method() ResourceWarning: Enable tracemalloc to get the object allocation traceback
1 parent ab1e07c commit c13179d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

supervisor/tests/test_dispatchers.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def test_no_logfile_and_syslog(self):
554554
self.assertEqual(len(dispatcher.mainlog.handlers), 1)
555555
self.assertEqual(dispatcher.mainlog.handlers[0].__class__,
556556
SyslogHandler)
557-
557+
558558
def test_logfile_and_no_syslog(self):
559559
from supervisor.datatypes import boolean, logfile_name
560560
from supervisor.loggers import FileHandler, LevelsByName
@@ -571,7 +571,8 @@ def test_logfile_and_no_syslog(self):
571571
self.assertEqual(dispatcher.fd, 0)
572572
self.assertEqual(len(dispatcher.mainlog.handlers), 1)
573573
self.assertEqual(dispatcher.mainlog.handlers[0].__class__, FileHandler)
574-
574+
dispatcher.mainlog.close()
575+
575576
def test_logfile_and_syslog(self):
576577
from supervisor.datatypes import boolean, logfile_name
577578
from supervisor.loggers import FileHandler, LevelsByName, SyslogHandler
@@ -591,8 +592,7 @@ def test_logfile_and_syslog(self):
591592
dispatcher.mainlog.handlers))
592593
self.assertTrue(any(isinstance(h, SyslogHandler) for h in
593594
dispatcher.mainlog.handlers))
594-
595-
595+
dispatcher.mainlog.close()
596596

597597

598598
class PInputDispatcherTests(unittest.TestCase):

0 commit comments

Comments
 (0)