forked from mirrors/bookwyrm
Add support for pytest
This commit is contained in:
parent
58237b6984
commit
0b8a9cf1a6
5 changed files with 18 additions and 1 deletions
2
.coveragerc
Normal file
2
.coveragerc
Normal file
|
@ -0,0 +1,2 @@
|
|||
[run]
|
||||
omit = */test*,celerywyrm*,bookwyrm/migrations/*
|
|
@ -22,6 +22,7 @@ services:
|
|||
- main
|
||||
web:
|
||||
build: .
|
||||
env_file: .env
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/app
|
||||
|
|
9
fr-dev
9
fr-dev
|
@ -46,6 +46,9 @@ case "$1" in
|
|||
migrate)
|
||||
runweb python manage.py migrate
|
||||
;;
|
||||
bash)
|
||||
runweb bash
|
||||
;;
|
||||
shell)
|
||||
runweb python manage.py shell
|
||||
;;
|
||||
|
@ -59,6 +62,10 @@ case "$1" in
|
|||
shift 1
|
||||
runweb coverage run --source='.' --omit="*/test*,celerywyrm*,bookwyrm/migrations/*" manage.py test "$@"
|
||||
;;
|
||||
pytest)
|
||||
shift 1
|
||||
runweb pytest "$@"
|
||||
;;
|
||||
test_report)
|
||||
runweb coverage report
|
||||
;;
|
||||
|
@ -72,6 +79,6 @@ case "$1" in
|
|||
clean
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognised command. Try: build, clean, up, initdb, resetdb, makemigrations, migrate, shell, dbshell, restart_celery, test, test_report"
|
||||
echo "Unrecognised command. Try: build, clean, up, initdb, resetdb, makemigrations, migrate, bash, shell, dbshell, restart_celery, test, pytest, test_report"
|
||||
;;
|
||||
esac
|
||||
|
|
4
pytest.ini
Normal file
4
pytest.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
[pytest]
|
||||
DJANGO_SETTINGS_MODULE = bookwyrm.settings
|
||||
python_files = tests.py test_*.py *_tests.py
|
||||
addopts = --cov=bookwyrm --cov-config=.coveragerc
|
|
@ -8,6 +8,9 @@ Pillow>=7.1.0
|
|||
psycopg2==2.8.4
|
||||
pycryptodome==3.9.4
|
||||
python-dateutil==2.8.1
|
||||
pytest_django==4.1.0
|
||||
pytest==6.1.2
|
||||
pytest-cov==2.10.1
|
||||
redis==3.4.1
|
||||
requests==2.22.0
|
||||
responses==0.10.14
|
||||
|
|
Loading…
Reference in a new issue