Skip to content

Commit

Permalink
run pytest with demo app settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Jun 21, 2024
1 parent 83b82ee commit 94e066a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 39 deletions.
16 changes: 3 additions & 13 deletions demo/demo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from __future__ import annotations

from os import environ
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
Expand Down Expand Up @@ -86,19 +85,10 @@
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': str(BASE_DIR / 'db.sqlite3'),
# },
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": environ["POSTGRES_DB"],
"USER": environ["POSTGRES_USER"],
"PASSWORD": environ["POSTGRES_PASSWORD"],
"HOST": "localhost",
"PORT": environ["POSTGRES_PORT"],
"ATOMIC_REQUESTS": False,
}
"ENGINE": "django.db.backends.sqlite3",
"NAME": str(BASE_DIR / "db.sqlite3"),
},
}

AUTH_PASSWORD_VALIDATORS = [
Expand Down
18 changes: 0 additions & 18 deletions demo/docker-compose.yml

This file was deleted.

27 changes: 21 additions & 6 deletions pdm.lock

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

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.pytest.ini_options]
pythonpath = ["."] # allow for `import tests` in test files
pythonpath = [".", "demo"] # allow for `import tests` in test files
target_package_name = "fingerprint" # required by pytest-apiver
DJANGO_SETTINGS_MODULE="tests.settings"
DJANGO_SETTINGS_MODULE="demo.settings"

[tool.pdm]
distribution = true
Expand All @@ -50,6 +50,7 @@ test = [
"pytest-asyncio",
"pytest-django",
"pytest-xdist",
"django-debug-toolbar>=4.4.2",
]
lint = [
"codespell[toml]",
Expand Down

0 comments on commit 94e066a

Please sign in to comment.