diff --git a/requirements/dev.in b/requirements/dev.in index 84ed92b77ed04bf36196fe6a119e21d103be2b11..731ed01e1af84c1be4f8cb4402535866e70e6a82 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 3bba66b31b516802c120d0fab6bef57e978ed0f3..61ed7fa0e624c55a048525c35916f89e98f9b759 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 bfdde35552afe6431d9a3c435dd6658e68bdedc8..d694f0208cd460c15822cd23eb1989da048fc70c 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 da2cabc147d01c14fef08aa95bba113814d7920c..40f1f65b35924eaa332d85b29655bbe799e6d72d 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 a33905906322e145c274714c4b582d4ae0f86f9d..e10769a6ca156de204374c4b2e09918cc122d86d 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 657bfe442e03b1c567b4d6e33fb13817604374f3..c5a38af4303dc10dc3649b81c8870cc90639afd2 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 # ---------------------------------------------------------------------------------