Reuse app fixture in tests

This commit is contained in:
dmitry.dygalo
2018-08-26 16:43:14 +02:00
parent 30e6a310f1
commit fec81ffe73
28 changed files with 253 additions and 510 deletions

View File

@@ -2,15 +2,13 @@ import multiprocessing
import random
import signal
from sanic import Sanic
from sanic.testing import HOST, PORT
def test_multiprocessing():
def test_multiprocessing(app):
"""Tests that the number of children we produce is correct"""
# Selects a number at random so we can spot check
num_workers = random.choice(range(2, multiprocessing.cpu_count() * 2 + 1))
app = Sanic('test_multiprocessing')
process_list = set()
def stop_on_alarm(*args):