Start worker using subprocess
This is because it ends up forking the tests else, which is really weird, and bad
This commit is contained in:
parent
ea7f195d0a
commit
73328303d4
1 changed files with 8 additions and 4 deletions
|
@ -1,5 +1,7 @@
|
|||
import functools
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from aiohttp.test_utils import unused_port
|
||||
from aiounittest import AsyncTestCase
|
||||
|
@ -28,10 +30,12 @@ class BaseWorkerTestCase(BaseTestCase):
|
|||
def setUp(self):
|
||||
super().setUp()
|
||||
self.unused_port = unused_port()
|
||||
result = self.run_cli(["start", "--port", self.unused_port])
|
||||
self.assertEqual(result.exit_code, 0, result.stdout)
|
||||
result = subprocess.run(
|
||||
[shutil.which("ctf"), "start", "--port", str(self.unused_port)]
|
||||
)
|
||||
self.assertEqual(result.returncode, 0)
|
||||
|
||||
def tearDown(self):
|
||||
result = self.run_cli(["stop"])
|
||||
self.assertEqual(result.exit_code, 0, result.stdout)
|
||||
result = subprocess.run([shutil.which("ctf"), "stop"])
|
||||
self.assertEqual(result.returncode, 0)
|
||||
super().tearDown()
|
||||
|
|
Reference in a new issue