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
|
#!/bin/sh
set -ex
# testsuite - run tests in our test environment
# This runs most unit tests from the source package. It does not run the
# doctests that are embedded in the source code itself.
# Copy the test suite to the temporary directory
cp -rp tests "$AUTOPKGTEST_TMP/"
# Prepare config for pytest
cat > "$AUTOPKGTEST_TMP/pytest.ini" << EOM
[pytest]
addopts = --doctest-glob="*.doctest" tests
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
EOM
# Run the tests from the temporary directory
for py in $(py3versions -r 2>/dev/null);
do
cd "$AUTOPKGTEST_TMP"
echo "Testing with $py:"
$py -m pytest
done
|