mirror of
https://github.com/chubin/cheat.sh.git
synced 2025-01-05 20:04:38 +03:00
distinguish between python2 and python3 tests
This commit is contained in:
parent
51347aee92
commit
166cdf5da5
@ -11,6 +11,7 @@
|
||||
# 3) run the script
|
||||
|
||||
PYTHON="${PYTHON:-../ve/bin/python}"
|
||||
"$PYTHON" --version 2>&1 | grep -q 'Python 2' && python_version=2 || python_version=3
|
||||
|
||||
skip_online="${CHEATSH_TEST_SKIP_ONLINE:-NO}"
|
||||
test_standalone="${CHEATSH_TEST_STANDALONE:-YES}"
|
||||
@ -24,6 +25,8 @@ trap 'rm -rf $TMP $TMP2 $TMP3' EXIT
|
||||
export CHTSH_URL=http://cht.sh:50000
|
||||
CHTSH_SCRIPT=$(dirname "$(dirname "$(readlink -f "$0")")")/share/cht.sh.txt
|
||||
|
||||
export PYTHONIOENCODING=UTF-8
|
||||
|
||||
i=0
|
||||
failed=0
|
||||
{
|
||||
@ -43,6 +46,14 @@ while read -r number test_line; do
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$python_version" = 2 ]] && [[ $test_line = *\[python3\]* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$python_version" = 3 ]] && [[ $test_line = *\[python2\]* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
#shellcheck disable=SC2001
|
||||
test_line=$(echo "$test_line" | sed 's@ *#.*@@')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user