Make test runs work from any directory

This commit is contained in:
Andreas Zweili 2023-07-13 23:02:56 +02:00
parent dd6603992d
commit f82c2bcc23
3 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,9 @@
[paths]
source = ${PROJECT_DIR-default .}/src/
[html]
directory = ${PROJECT_DIR-default .}/htmlcov
[run]
data_file = ${PROJECT_DIR-default .}/.coverage
omit =
*apps.py,
*migrations/*,

1
.envrc
View File

@ -10,3 +10,4 @@ layout_postgres() {
fi
}
layout postgres
export PROJECT_DIR=$(pwd)

2
dev.sh
View File

@ -71,7 +71,7 @@ check (){
test (){
export DJANGO_SETTINGS_MODULE=network_inventory.settings.ram_test
pytest -nauto --nomigrations --cov-report=html --cov=./src ./src
pytest -nauto --nomigrations --cov-config="$PROJECT_DIR/.coveragerc" --cov-report=html "$PROJECT_DIR/src"
}
update (){