#!/bin/sh

set -efu

sudo -u postgres psql \
-c 'CREATE USER pygresql WITH PASSWORD '\''pygresql'\'' CREATEDB;' \
-c 'CREATE DATABASE pygresql OWNER pygresql;'

export PYGRESQL_DB=pygresql
export PYGRESQL_USER=pygresql
export PYGRESQL_PASSWD=pygresql

cp -a tests $AUTOPKGTEST_TMP

cd $AUTOPKGTEST_TMP

for py in $(py3versions -s); do
	echo "Testing with: $py"
	$py -m unittest discover -v
done
