From cd8cae18c51ba286b75b33aec6abbf11040bb508 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 13 Dec 2018 17:10:14 +0000 Subject: [PATCH] Use the CLI to run the app --- tests/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index ebf9dc8..ea5f144 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,5 @@ import functools import os -from multiprocessing import Process from aiohttp.test_utils import unused_port from aiounittest import AsyncTestCase @@ -32,12 +31,8 @@ class BaseWorkerTestCase(BaseTestCase): def setUp(self): super().setUp() self.unused_port = unused_port() - self.router_process = Process( - target=worker.run, args=(self.unused_port,), daemon=True - ) - self.router_process.start() - worker.wait_for_running_worker() + self.assertEqual(self.run_cli(["start"]).exit_code, 0) def tearDown(self): - self.router_process.terminate() + self.assertEqual(self.run_cli(["stop"]).exit_code, 0) super().tearDown()