From c58d19bbebbdd7809c20052e6d2106aa6197edf3 Mon Sep 17 00:00:00 2001 From: Lasse Schuirmann Date: Wed, 8 Apr 2015 08:30:23 +0200 Subject: [PATCH] SectionExecutorTest: Close output objects --- coalib/tests/processes/SectionExecutorTest.py | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/coalib/tests/processes/SectionExecutorTest.py b/coalib/tests/processes/SectionExecutorTest.py index 2f3158be14..966d4a4702 100644 --- a/coalib/tests/processes/SectionExecutorTest.py +++ b/coalib/tests/processes/SectionExecutorTest.py @@ -35,46 +35,48 @@ def begin_section(self, name): class SectionExecutorInitTestCase(unittest.TestCase): def test_init(self): + interactor = ConsoleInteractor() + log_printer = ConsolePrinter() self.assertRaises(TypeError, SectionExecutor, 5, [], [], - ConsoleInteractor(), - ConsolePrinter()) + interactor, + log_printer) self.assertRaises(TypeError, SectionExecutor, Section("test"), 5, [], - ConsoleInteractor(), - ConsolePrinter()) + interactor, + log_printer) self.assertRaises(TypeError, SectionExecutor, Section("test"), [], 5, - ConsoleInteractor(), - ConsolePrinter()) + interactor, + log_printer) self.assertRaises(TypeError, SectionExecutor, Section("test"), [], [], 5, - ConsolePrinter()) + log_printer) self.assertRaises(TypeError, SectionExecutor, Section("test"), [], [], - ConsoleInteractor(), + interactor, 5) SectionExecutor(Section("test"), [], [], - ConsoleInteractor(), - ConsolePrinter()).run + interactor, + log_printer) class SectionExecutorTestCase(unittest.TestCase): @@ -104,6 +106,9 @@ def setUp(self): self.interactor, self.interactor) + def tearDown(self): + self.interactor.close() + def test_run(self): self.assertTrue(self.uut.run())