Skip to content

Commit 39839f4

Browse files
author
feger
committed
Improve tests.sh by simply using major python version number.
1 parent 9e72664 commit 39839f4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests.sh

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/bin/bash
22

3-
PYTHON_VERSION=`python -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)";`
3+
PYTHON_VERSION=`python -c "import platform; print(int(platform.python_version()[:1]))"`
4+
VERSION_THRESHOLD=3
45

56
echo "running tests on python $PYTHON_VERSION.x..."
67

7-
if [[ $PYTHON_VERSION == 3.* ]] ;
8-
then
9-
. run_tests_py3.sh
8+
if [[ ${PYTHON_VERSION} -ge ${VERSION_THRESHOLD} ]]; then
9+
bash ./run_tests_py3.sh
1010
else
11-
nosetests
12-
fi
13-
11+
nosetests
12+
fi

0 commit comments

Comments
 (0)