Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,27 @@ err_report() {

trap 'err_report' ERR

if tty --quiet; then
# enable debugging with [PuDB](https://youtu.be/bJYkCWPs_UU)
export PUDB_TTY
PUDB_TTY="$(tty)"
fi

PYTHON_VERSION2="$(python3 -c 'if True:
import sys
major, minor = sys.version_info[:2]
print(major, minor, sep=".")
')"

if [[ $PYTHON_VERSION != $PYTHON_VERSION2 ]]; then
echo >&2 \
"wrong python version! (found $PYTHON_VERSION2 expected $PYTHON_VERSION)" \
exit 1
fi

cat "test/${PYTHON_VERSION}_unformatted.py" | python3 cblack.py -q - > test/${PYTHON_VERSION}_reformatted.py

diff test/${PYTHON_VERSION}_expected.py test/${PYTHON_VERSION}_reformatted.py
diff -u --color=always test/${PYTHON_VERSION}_expected.py test/${PYTHON_VERSION}_reformatted.py

echo "Test ${PYTHON_VERSION} Succeeded!"
exit 0