From 4d31850e33b163c531f115f10e892c4f6bbc27ac Mon Sep 17 00:00:00 2001 From: John Rofrano Date: Wed, 15 Nov 2023 12:06:28 +0000 Subject: [PATCH 1/2] Updated dev environment --- .devcontainer/devcontainer.json | 17 +++++++++++++++++ .vscode/settings.json | 21 --------------------- 2 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8e296f2..57362a2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,6 +7,23 @@ "remoteUser": "devops", "customizations": { "vscode": { + "settings": { + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.formatOnSave": true + }, + "python.testing.pytestEnabled": false, + "python.testing.unittestEnabled": true, + "pylint.lintOnChange": true, + "markdown-preview-github-styles.colorTheme": "light", + "files.exclude": { + "**/.git": true, + "**/.DS_Store": true, + "**/*.pyc": true, + "**/__pycache__": true, + "**/.pytest_cache": true + } + }, "extensions": [ "VisualStudioExptTeam.vscodeintellicode", "ms-python.python", diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 904320d..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "python.linting.pylintEnabled": true, - "python.linting.enabled": true, - "python.testing.nosetestsEnabled": true, - "python.testing.nosetestArgs": ["-c=setup.cfg"], - "cucumberautocomplete.steps": ["features/steps/*.py"], - "cucumberautocomplete.syncfeatures": "features/*.feature", - "cucumberautocomplete.strictGherkinCompletion": true, - "cucumberautocomplete.strictGherkinValidation": true, - "cucumberautocomplete.smartSnippets": true, - "cucumberautocomplete.gherkinDefinitionPart": "@(given|when|then)\\(", - "python.testing.unittestArgs": [ - "-v", - "-s", - "./tests", - "-p", - "test_*.py" - ], - "python.testing.pytestEnabled": false, - "python.testing.unittestEnabled": true, -} \ No newline at end of file From c172e4fd8b3409f33c00a951c3272cde71de8bf2 Mon Sep 17 00:00:00 2001 From: John Rofrano Date: Wed, 15 Nov 2023 12:06:41 +0000 Subject: [PATCH 2/2] Added pytest suoport --- requirements.txt | 19 +++++++++++-------- setup.cfg | 7 +++++++ tests/__init__.py | 0 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 tests/__init__.py diff --git a/requirements.txt b/requirements.txt index 2310fda..3730d78 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ # Pinned dependencies that cause breakage -Werkzeug==2.3.3 +Werkzeug==3.0.1 urllib3==1.26.15 # Runtime dependencies -Flask==2.3.2 +Flask==2.3.3 flask-restx==1.1.0 cloudant==2.15.0 retry2==0.9.5 @@ -14,14 +14,17 @@ gunicorn==20.1.0 honcho==1.1.0 # Code quality -pylint==2.16.2 -flake8==6.0.0 -black==23.1.0 +pylint==2.17.5 +flake8==6.1.0 +black==23.7.0 # Testing dependencies -green==3.4.3 +pytest==7.4.0 +pytest-pspec==0.0.4 +pytest-cov==4.1.0 +coverage==7.3.0 factory-boy==3.2.1 -coverage==7.1.0 +green==3.4.3 # Utilities -httpie==3.2.1 +httpie==3.2.2 diff --git a/setup.cfg b/setup.cfg index 607456a..ff7adc1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,10 @@ +[tool:pytest] +minversion = 6.0 +addopts = --pspec --cov=service --cov-fail-under=95 --disable-warnings +testpaths = + tests + integration + [green] verbose=3 processes=1 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29