Skip to content

Commit

Permalink
get pytest working
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Sep 28, 2023
1 parent f4768bf commit 59f0061
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"black-formatter.args": [
"--config",
"pyproject.toml"
],
"python.testing.pytestArgs": [
"tests"
"-c=pyproject.toml",
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pytest-django = "==4.5.2"
django-extensions = "==3.2.1"
pyparsing = "==3.0.9"
pydot = "==1.4.2"
pytest-env = "==0.8.1"

[requires]
python_version = "3.8"
14 changes: 11 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from codeforlife.settings import *

BASE_DIR = Path(__file__).resolve().parent

INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
Expand Down Expand Up @@ -41,6 +43,13 @@
},
]

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}

if __name__ == "__main__":
import os
import sys
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ line-length = 80
extend-exclude = "^/setup.py|^/codeforlife/user/migrations/"

[tool.pytest.ini_options]
# env = ["DJANGO_SETTINGS_MODULE=example_project.settings"]
DJANGO_SETTINGS_MODULE = "manage"
python_files = "tests.py test_*.py"
env = ["DJANGO_SETTINGS_MODULE=manage"]

0 comments on commit 59f0061

Please sign in to comment.