forked from w-a-r-m-inventory-system/Food-Pantry-Inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_pytest
executable file
·32 lines (26 loc) · 839 Bytes
/
run_pytest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# shell script to run pytest from the top of the inventory project
#
# Usage:
# run_pytest
# runs pytest on project with no "coverage"
#
# run_pytest -n n
# runs pytest using n cores (faster)
#
# run_pytest -c pytest_w_cov.ini
# runs pytest with coverage
#
# run_pytest -n n -c pytest_w_cov.ini
# runs pytest with multiple cores and coverage
# Activate the virtual environment if needed
if [ X = X`echo deactivate` ]
then
source VIRTUAL_BIN_LOCATION/activate
fi
# identify location of the setting file for Django
export DJANGO_SETTINGS_MODULE=FPIDjango.settings
# assume pytest is in the current path
# add "-n 4" on the command line to use four cores for the tests
pytest "$@" -ra --fail-on-template-vars
# EOF