From 4b64986e1fef2f47db3aa99228256c94a84cced9 Mon Sep 17 00:00:00 2001 From: oro13 Date: Fri, 1 Jan 2021 11:07:44 -0800 Subject: [PATCH] add test coverage and readme --- api/requirements.txt | 2 ++ api/tests/README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 api/tests/README.md diff --git a/api/requirements.txt b/api/requirements.txt index 25c67c3..576ae6f 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -5,6 +5,7 @@ blinker==1.4 certifi==2019.3.9 chardet==3.0.4 Click==7.0 +coverage==5.3.1 Flask==1.0.3 Flask-Babel==0.12.2 Flask-Cors==3.0.8 @@ -31,6 +32,7 @@ py==1.10.0 Pygments==2.4.2 pyparsing==2.4.7 pytest==6.2.1 +pytest-cov==2.10.1 pytest-flask==1.1.0 python-dateutil==2.8.0 python-dotenv==0.10.2 diff --git a/api/tests/README.md b/api/tests/README.md new file mode 100644 index 0000000..f9f7fc0 --- /dev/null +++ b/api/tests/README.md @@ -0,0 +1,26 @@ +To conduct tests, go to the api folder and run (from the venv): + +`python3 -m pytest` + +for additional output: + +`python3 -m pytest -v` + +for even more output: + +`python3 -m pytest -vv` + +for test coverage: + +`python3 -m pytest -v --cov=app` + +normal pytest arguments work as well, placed before `--cov=app`. + +See the docs for more information: + +[pytest](https://pytest.org/en/latest/index.html) + +[pytest-flask](https://pytest-flask.readthedocs.io) + +[pytest-cov](https://pytest-flask.readthedocs.io) +