#!/bin/sh

set -e

export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export TZ=UTC # suppress UnknownTimeZoneError('Etc/UTC',)

# clean up afterwards
trap 'rm -f /tmp/pgpass?' 0 2 3 15

python3 -m pytest tests

# in case this script is run as root, remove the top-level data directory so
# that subsequent tests can potentially created it again as another user
rm -rf data
