#! /bin/bash

set -e

PYS=$(py3versions -s)

cp -a pytest.ini tests "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"

for py in $PYS
do
    echo "Testing with $py:"
    # Some tests are slightly flaky, so we run the suite up to three times
    # (It would be nice to make this more efficient as in the spyder package)
    $py -m pytest || $py -m pytest -n1 || $py -m pytest -n1
done
