#! /bin/sh

set -efu

# We need to set up a home directory for some of the pytest tests, but
# we cannot do so within the script as it gets deleted too early, before
# the pytest finalisers have run.  So we set it up it here (and
# autopkgtest will delete it afterwards).
PYS=$(py3versions -s)
for py in $PYS; do
    echo "Testing with $py:"

    tempdir=$(mktemp -d -p "$AUTOPKGTEST_TMP")
    export HOME="$tempdir"

    xvfb-run -a -s "-screen 0 1024x768x24" \
        $py -m pytest qtconsole/tests
done
