curl-and-python

[PATCH 2/2] tests/run.sh: allow to override $PYTHON and $NOSETESTS

From: Kamil Dudka via curl-and-python <curl-and-python_at_cool.haxx.se>
Date: Mon, 2 Nov 2015 17:06:57 +0100

... needed for building Fedora packages where both Python 2 and Python 3
modules need to be built on the same system.

---
 tests/run.sh | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/run.sh b/tests/run.sh
index 7bb9cd0..ac5de59 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -3,8 +3,11 @@
 set -e
 set -x
 
+test -n "$PYTHON" || PYTHON=python
+test -n "$NOSETESTS" || NOSETESTS=nosetests
+
 mkdir -p tests/tmp
-export PYTHONSUFFIX=$(python -V 2>&1 |awk '{print $2}' |awk -F. '{print $1 "." $2}')
+export PYTHONSUFFIX=$($PYTHON -V 2>&1 |awk '{print $2}' |awk -F. '{print $1 "." $2}')
 export PYTHONPATH=$(ls -d build/lib.*$PYTHONSUFFIX):$PYTHONPATH
 
 extra_attrs=
@@ -16,6 +19,6 @@ if test "$CI" = true; then
   fi
 fi
 
-python -c 'import pycurl; print(pycurl.version)'
-nosetests -a \!standalone"$extra_attrs" --with-flaky "$@"
-nosetests -a standalone --with-flaky "$@"
+$PYTHON -c 'import pycurl; print(pycurl.version)'
+$NOSETESTS -a \!standalone"$extra_attrs" --with-flaky "$@"
+$NOSETESTS -a standalone --with-flaky "$@"
-- 
2.5.2
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2015-11-02