File: run-unit-test

package info (click to toggle)
q2-sample-classifier 2024.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,732 kB
  • sloc: python: 5,060; makefile: 41; sh: 13
file content (25 lines) | stat: -rw-r--r-- 608 bytes parent folder | download
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
#!/bin/bash
set -e

pkg=q2_sample_classifier

if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/lib/python3/dist-packages/${pkg}* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"
if [ ! -f /usr/lib/python3/dist-packages/pytest_cov/__init__.py ] ; then
	echo "Please install package python3-pytest-cov to run this script"
	exit 1
fi

# Run build-time tests
# for py in $(py3versions -s 2> /dev/null)
# do
#     ${py} -m pytest -v  --cov=${pkg}
# done
#
python3.11 -m pytest -v  --cov=${pkg}