From 8212caafb0794e1b75f5af79806502847510b91b Mon Sep 17 00:00:00 2001 From: matthieu Date: Thu, 8 Feb 2018 23:53:45 +0100 Subject: [PATCH] Uncomment sleep in resources and minor fixes --- api/resources/main.py | 4 ++-- run.py | 3 +++ test/conftest.py | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api/resources/main.py b/api/resources/main.py index 662307e..1bdad55 100644 --- a/api/resources/main.py +++ b/api/resources/main.py @@ -1,6 +1,6 @@ """Entrypoint of the main API Resources.""" # Useful to simulate a long action -# from time import sleep +from time import sleep # Flask based imports from flask_restplus import Resource, Namespace @@ -40,5 +40,5 @@ def get(self, name): @celery.task() def asynchronous(name): """Async long task method.""" - # sleep(5) + sleep(5) return {'async': name} diff --git a/run.py b/run.py index fe1453e..b314609 100644 --- a/run.py +++ b/run.py @@ -2,6 +2,9 @@ # Api factory import from api import factory +# Eventually force the environment +# factory.environment = 'default' + # Get flask instance app = factory.flask diff --git a/test/conftest.py b/test/conftest.py index f66a438..78b64fa 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -39,8 +39,8 @@ def flask_app(factory_app): def celery_app(factory_app): """Fixture of celery instance creation.""" factory_app.set_flask() - factory_app.register(blueprint) factory_app.set_celery() + factory_app.register(blueprint) yield factory_app @@ -54,6 +54,6 @@ def flask_app_client(flask_app): @pytest.yield_fixture(scope='session') -def byeworld(celery_app): +def byeworld(): """Fixture of ByeWorld resource.""" - return ByeWorld() + return ByeWorld