From fd0bf49b0519003aed10bfe770be3c2254eddd47 Mon Sep 17 00:00:00 2001 From: thomaswoehlke <thomas.woehlke@gmail.com> Date: Sun, 21 Feb 2021 00:48:07 +0100 Subject: [PATCH] working for 0.0.198 Release --- requirements/dev.in | 6 +----- requirements/tests.in | 7 +++++-- setup.py | 5 ++++- tests/conftest.py | 2 ++ tests/test_mq.py | 1 + tests/test_web.py | 16 ++++++++++++++++ 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/requirements/dev.in b/requirements/dev.in index 84ed92b7..731ed01e 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -8,15 +8,11 @@ dtale>=1.34.0 Flask>=1.1.2 Flask-SQLAlchemy>=2.4.4 Flask-Cors>=3.0.10 -Flask-BS4==4.5.3.0 +Flask-BS4>=4.5.3.0,<5.0.0.0 SQLAlchemy>=1.3.23 psycopg2>=2.8.6 wget>=3.2 celery[redis]>=5.0.5 -Flask-PluginKit -Flask-ResponseBuilder -plantuml-creator -plantuml-markdown flask-resources==0.6.0 Flask-PluginKit>=3.6.0 Flask-ResponseBuilder>=2.0.12 diff --git a/requirements/tests.in b/requirements/tests.in index 3bba66b3..61ed7fa0 100644 --- a/requirements/tests.in +++ b/requirements/tests.in @@ -1,12 +1,15 @@ +pytoml pytest==5.3.2 pytest-runner==5.3.0 +pytest-flask +pytest-flask-sqlalchemy +pytest-mock +pytest-celery blinker greenlet python-dotenv -pytest-flask test-flask unittest2>=1.0.0 extras>=1.0.0 fixtures>=1.3.0 python-mimeparse -pytoml diff --git a/setup.py b/setup.py index bfdde355..d694f020 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,10 @@ requires_test = [ "python-dotenv==0.15.0", "test-flask==0.2.0", "wcwidth==0.2.5", - "werkzeug==1.0.1" + "werkzeug==1.0.1", + "pytest_celery>=0.0.0a1", + "pytest-flask-sqlalchemy-1.0.2", + "pytest-mock-3.5.1" ] requires_docs = [ diff --git a/tests/conftest.py b/tests/conftest.py index da2cabc1..40f1f65b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,6 +3,8 @@ import tempfile import pytest from database import create_app, create_db_test, create_admin +pytest_plugins = ("celery.contrib.pytest", ) + @pytest.fixture def app(): diff --git a/tests/test_mq.py b/tests/test_mq.py index a3390590..e10769a6 100644 --- a/tests/test_mq.py +++ b/tests/test_mq.py @@ -5,6 +5,7 @@ import covid19_worker from covid19 import app from covid19.blueprints.application.application_workers import celery, run_mq +# Celery: https://docs.celeryproject.org/en/stable/userguide/index.html # --------------------------------------------------------------------------------- # MAIN diff --git a/tests/test_web.py b/tests/test_web.py index 657bfe44..c5a38af4 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -4,6 +4,22 @@ import covid19.blueprints.application.application_views from covid19 import run_web +# https://realpython.com/pytest-python-testing/ +# https://www.guru99.com/pytest-tutorial.html +# +# +# https://docs.pytest.org/en/stable/ +# https://www.jetbrains.com/help/pycharm/pytest.html +# https://docs.celeryproject.org/en/stable/userguide/testing.html +# +# https://werkzeug.palletsprojects.com/en/1.0.x/test/#werkzeug.test.Client +# https://flask.palletsprojects.com/en/1.1.x/testing/ +# https://flask.palletsprojects.com/en/1.1.x/tutorial/tests/ +# +# https://flask.palletsprojects.com/en/1.1.x/tutorial/install/ +# https://packaging.python.org/tutorials/packaging-projects/ + + # --------------------------------------------------------------------------------- # MAIN # --------------------------------------------------------------------------------- -- GitLab