Skip to content

Commit

Permalink
migrate to pytest-freezer
Browse files Browse the repository at this point in the history
  • Loading branch information
e-stepanov committed Sep 25, 2024
1 parent aa8dea9 commit 25628b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
name: generated
path: testproject

include-hidden-files: true

build-docker-image:
needs: bootstrap
Expand All @@ -71,6 +71,10 @@ jobs:
- name: setup buildx
uses: docker/setup-buildx-action@v3

- name: check .env file
run: |
cat testproject/src/app/.env
- name: make sure docker image is buildable
uses: docker/build-push-action@v6
with:
Expand Down
6 changes: 1 addition & 5 deletions {{ cookiecutter.name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pymarkdownlnt = "^0.9.21"
pytest-deadfixtures = "^2.2.1"
pytest-django = "^4.7.0"
pytest-env = "^1.1.1"
pytest-freezegun = "^0.4.2"
pytest-freezer = "^0.4.8"
pytest-mock = "^3.12.0"
pytest-randomly = "^3.15.0"
pytest-xdist = "^3.6.1"
Expand Down Expand Up @@ -119,10 +119,6 @@ env = [
]
filterwarnings = [
"ignore:.*'rest_framework_jwt.blacklist' defines default_app_config.*You can remove default_app_config.::django",
"ignore:distutils Version classes are deprecated. Use packaging.version instead.:DeprecationWarning:pytest_freezegun:17",
]
markers = [
"freeze_time: freezing time marker (pytest-freezegun does not register it)",
]
python_files = ["test*.py"]
pythonpath = ". src"
Expand Down
4 changes: 4 additions & 0 deletions {{ cookiecutter.name }}/src/app/conf/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

if envpath.exists():
env.read_env(envpath)
else:
from django.core.exceptions import ImproperlyConfigured

raise ImproperlyConfigured(".env is missing")

__all__ = [
"env",
Expand Down

0 comments on commit 25628b7

Please sign in to comment.