Limiting the supported python versions to >= 2.6 permits to avoid unneccessary
code to permit the use of unittest in all python 2 and 3 versions such as:
import sys
if sys.version_info[0] >= 3:
import unittest
else:
import unittest2 as unittest
python2.7 is the default version in Debian unstable since Sep 2011.
Build-Depends: debhelper (>> 7.0.50~),
po-debconf (>= 0.5.0),
dpkg-dev (>= 1.10),
- python-all-dev (>= 2.6.6-6~)
+ python-all-dev (>= 2.6.6-6~),
+X-Python-Version: >= 2.7
Standards-Version: 3.9.3
Homepage: http://www.linuxfoundation.org/collaborate/workgroups/lsb
Vcs-Git: git://anonscm.debian.org/collab-maint/lsb.git
derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")
+PY2VERSIONS=$(shell pyversions -vr)
+
%:
dh --with python2 $@
dh_clean
rm -f *.py[co]
+override_dh_auto_test: $(PY2VERSIONS:%=test-python%)
+
+test-python%:
+ PYTHONPATH=. python$* test/test_lsb_release.py -vv
+
override_dh_python2:
dh_python2
dh_python2 /usr/lib/lsb
--- /dev/null
+#!/usr/bin/python
+import unittest
+
+import lsb_release as lr
+
+import random
+import string
+
+class TestLSBRelease(unittest.TestCase):
+
+ def test_void(self):
+ self.assertTrue('Void test')
+
+if __name__ == '__main__':
+ unittest.main()