diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8f192c4a0..db78bfbcb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,6 @@ }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "bungcip.better-toml", "batisteo.vscode-django", "bpruitt-goddard.mermaid-markdown-syntax-highlighting", "eamodio.gitlens", @@ -28,10 +27,12 @@ "hashicorp.terraform", "mhutchie.git-graph", "monosans.djlint", - "ms-python.python", - "ms-python.vscode-pylance", "mrorz.language-gettext", - "qwtel.sqlite-viewer" + "ms-python.python", + "ms-python.black-formatter", + "ms-python.flake8", + "qwtel.sqlite-viewer", + "tamasfe.even-better-toml" ] } } diff --git a/.vscode/settings.json b/.vscode/settings.json index b3ff8e30d..78ec3acc2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,17 +12,10 @@ "files.trimFinalNewlines": true, "files.trimTrailingWhitespace": true, "[python]": { - "editor.defaultFormatter": "ms-python.python" + "editor.defaultFormatter": "ms-python.black-formatter" }, - "python.formatting.provider": "black", "python.languageServer": "Pylance", - "python.linting.enabled": true, - "python.linting.flake8Enabled": true, - "python.testing.pytestArgs": [ - "tests/pytest", - "--import-mode=importlib", - "--no-migrations" - ], + "python.testing.pytestArgs": ["tests/pytest"], "python.testing.pytestEnabled": true, "python.testing.unittestEnabled": false, "[terraform]": { diff --git a/tests/pytest/core/test_models.py b/tests/pytest/core/test_models.py index eb345920b..6df589ce0 100644 --- a/tests/pytest/core/test_models.py +++ b/tests/pytest/core/test_models.py @@ -329,16 +329,18 @@ def test_TransitAgency_by_slug_nonmatching(): @pytest.mark.django_db def test_TransitAgency_all_active(model_TransitAgency): - assert TransitAgency.objects.count() == 1 + count = TransitAgency.objects.count() + assert count >= 1 inactive_agency = TransitAgency.by_id(model_TransitAgency.id) inactive_agency.pk = None inactive_agency.active = False inactive_agency.save() - assert TransitAgency.objects.count() == 2 + assert TransitAgency.objects.count() == count + 1 result = TransitAgency.all_active() - assert len(result) == 1 + assert len(result) > 0 assert model_TransitAgency in result + assert inactive_agency not in result diff --git a/tests/pytest/run.sh b/tests/pytest/run.sh index 37b044199..8d06749e6 100755 --- a/tests/pytest/run.sh +++ b/tests/pytest/run.sh @@ -2,7 +2,7 @@ set -eu # run normal pytests -coverage run -m pytest --no-migrations +coverage run -m pytest # clean out old coverage results rm -rf benefits/static/coverage