Code Duplication    Length = 14-19 lines in 3 locations

tests/test_webui.py 1 location

@@ 72-90 (lines=19) @@
69
        self.rpc = app.config['scheduler_rpc']
70
71
        time.sleep(1)
72
73
    @classmethod
74
    def tearDownClass(self):
75
        for each in self.ctx.obj.instances:
76
            each.quit()
77
        time.sleep(1)
78
79
        for thread in self.threads:
80
            thread.join()
81
82
        self.httpbin_thread.terminate()
83
        self.httpbin_thread.join()
84
85
        assert not utils.check_port_open(5000)
86
        assert not utils.check_port_open(23333)
87
        assert not utils.check_port_open(24444)
88
        assert not utils.check_port_open(25555)
89
        assert not utils.check_port_open(14887)
90
91
        shutil.rmtree('./data/tests', ignore_errors=True)
92
93
    def test_10_index_page(self):

tests/test_run.py 1 location

@@ 324-337 (lines=14) @@
321
322
        time.sleep(1)
323
324
    @classmethod
325
    def tearDownClass(self):
326
        for each in self.ctx.obj.instances:
327
            each.quit()
328
        self.xmlrpc_thread.join()
329
        self.scheduler_thread.join()
330
        time.sleep(1)
331
332
        assert not utils.check_port_open(5000)
333
        assert not utils.check_port_open(23333)
334
        assert not utils.check_port_open(24444)
335
        assert not utils.check_port_open(25555)
336
337
        shutil.rmtree('./data/tests', ignore_errors=True)
338
339
    def test_10_send_message(self):
340
        ctx = run.send_message.make_context('send_message', [

tests/test_scheduler.py 1 location

@@ 151-164 (lines=14) @@
148
        self.process = run_in_thread(run_scheduler)
149
        time.sleep(1)
150
151
    @classmethod
152
    def tearDownClass(self):
153
        if self.process.is_alive():
154
            self.rpc._quit()
155
            self.process.join(5)
156
        self.xmlrpc_thread.join()
157
        assert not self.process.is_alive()
158
        shutil.rmtree('./data/tests', ignore_errors=True)
159
        time.sleep(1)
160
161
        assert not utils.check_port_open(5000)
162
        assert not utils.check_port_open(self.scheduler_xmlrpc_port)
163
        assert not utils.check_port_open(24444)
164
        assert not utils.check_port_open(25555)
165
166
    def test_10_new_task_ignore(self):
167
        '''