PyUT: Run tests with python3 too.
authorDidier Raboud <odyx@debian.org>
Mon, 7 May 2012 17:12:27 +0000 (19:12 +0200)
committerDidier Raboud <odyx@debian.org>
Mon, 7 May 2012 19:04:24 +0000 (21:04 +0200)
Note: This currently makes the build fail in a non-clean environment without
py3versions available. This is semi-intended and is the easiest way to have
the tests run as python3 too.

debian/rules

index 590258d2fd91b59e72f1b638092d39b6f23b6a6f..317f4d061ea9ffe005d4688ba622e7745121b19f 100755 (executable)
@@ -3,6 +3,7 @@
 derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")
 
 PY2VERSIONS=$(shell pyversions -vr)
+PY3VERSIONS=$(shell [ -x /usr/bin/py3versions ] && py3versions -vr)
 
 %:
        dh --with python2 $@
@@ -46,7 +47,7 @@ override_dh_clean:
        dh_clean
        rm -f *.py[co]
 
-override_dh_auto_test: $(PY2VERSIONS:%=test-python%)
+override_dh_auto_test: $(PY2VERSIONS:%=test-python%) $(PY3VERSIONS:%=test-python%)
 
 test-python%:
        PYTHONPATH=. python$* test/test_lsb_release.py -vv