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 221542c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions hooks/post_gen_project.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -e

cp src/app/.env.ci src/app/.env
cat src/app/.env

poetry lock --no-update
poetry install
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 221542c

Please sign in to comment.