#!/bin/sh
set -e
cp -r test* "$AUTOPKGTEST_TMP/" && cd "$AUTOPKGTEST_TMP"
PYTEST_ARGS="-v --asyncio-mode=auto -x"
PYTEST_KEXPR=
if [ "$(dpkg --print-architecture)" = "riscv64" ]; then
    # This test has a hard-coded 2s multiprocessing timeout which is too
    # tight on riscv64 debci workers.
    PYTEST_KEXPR="not test_iterate_empty_psml_capture"
fi
for py in $(py3versions -s); do
    if [ -n "$PYTEST_KEXPR" ]; then
        $py -Wd -m pytest $PYTEST_ARGS -k "$PYTEST_KEXPR" 2>&1
    else
        $py -Wd -m pytest $PYTEST_ARGS 2>&1
    fi
done
