-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpytest.sh
executable file
·38 lines (32 loc) · 904 Bytes
/
pytest.sh
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
32
33
34
35
36
37
#!/bin/bash
#
# Run our unit tests
#
# Errors are fatal
set -e
# Change to the directory where this script lives
pushd $(dirname $0) > /dev/null
echo "# "
echo "# Running unit tests..."
echo "# "
echo "# If you want to run specific tests, try: "
echo "# "
echo "# $0 -k PATTERN"
echo "# "
#
# The reason we're checking for an argument here is because if we don't,
# Pytest will "helpfully" scan for all files starting with "test_", which will
# include file in lib/, which is obviously not a test.
#
TESTS=""
if ! test "$@"
then
TESTS="./tests"
fi
#
# We have to ignore deprecation warnings because it looks like the Swagger module
# hasn't yet caught up with Pydantic wanting "examples" instead of "example".
# Once Swagger is updated, I'll fix my code and stop ignoring deprecation warnings.
#
#python3 -m pytest -s ${TESTS} $@
python3 -m pytest -W ignore::DeprecationWarning -s ${TESTS} $@