From 47e761bbe2f4dd162ff459bd2695c4558b6754e0 Mon Sep 17 00:00:00 2001 From: Yun Xu Date: Sun, 11 Jun 2017 08:49:35 -0700 Subject: [PATCH 1/2] add coverage report --- tox.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 3092e875..de1dc2d5 100644 --- a/tox.ini +++ b/tox.ini @@ -9,16 +9,14 @@ setenv = deps = coverage pytest + pytest-cov pytest-sugar aiohttp==1.3.5 chardet<=2.3.0 beautifulsoup4 gunicorn commands = - pytest tests {posargs} - coverage erase - coverage run -m sanic.app - coverage report + pytest tests --cov sanic --cov-report term-missing {posargs} [testenv:flake8] deps = From ce2df8030c2430b71f8276107009bb3823590ccb Mon Sep 17 00:00:00 2001 From: Yun Xu Date: Sun, 11 Jun 2017 09:06:48 -0700 Subject: [PATCH 2/2] quick fix for test_gunicorn_worker test --- tests/test_worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_worker.py b/tests/test_worker.py index 73838f68..2c1a0123 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -11,7 +11,7 @@ import pytest def gunicorn_worker(): command = 'gunicorn --bind 127.0.0.1:1337 --worker-class sanic.worker.GunicornWorker examples.simple_server:app' worker = subprocess.Popen(shlex.split(command)) - time.sleep(1) + time.sleep(3) yield worker.kill()