#!/bin/sh

export LC_ALL=C.UTF-8
export HOME=$AUTOPKGTEST_TMP

# include xon.sh, which is used by test_integration
export PATH=/usr/share/xonsh:$PATH

touch $HOME/testfile
cp -r tests $AUTOPKGTEST_TMP
cd $AUTOPKGTEST_TMP

TESTARGS="--ignore tests/test_man.py --ignore tests/test_news.py --ignore tests/test_integrations.py --ignore tests/test_ptk_highlight.py --ignore tests/test_main.py --ignore tests/test_vox.py"
if python3 -c "import pty; pty.openpty()" > /dev/null 2>&1; then
    echo PTY available
else
    echo PTY unavailable, disabling tests involving subshells
    TESTARGS="$TESTARGS --ignore tests/test_xonsh.xsh"
fi

py.test-3 $TESTARGS
