summaryrefslogtreecommitdiff
path: root/selftest/selftesthelpers.py
diff options
context:
space:
mode:
authorLumir Balhar <lbalhar@redhat.com>2016-10-19 20:51:47 +0200
committerAndrew Bartlett <abartlet@samba.org>2016-12-01 05:54:21 +0100
commit8f8b0fd12a72630d6340ad976eccb431d265e4d0 (patch)
treeb1a12f9bfb197efc8f6d61ad66014da3bcfee3aa /selftest/selftesthelpers.py
parent358eaf810edd59cb16e95d77967a7b37ecf6bb94 (diff)
downloadsamba-8f8b0fd12a72630d6340ad976eccb431d265e4d0.tar.gz
python: selftesthelpers: Add possibility for planning tests for
'extra_python' (Python 3). This change allows us to mark modules which are Python 3 compatible with the keyword argument `py3_compatible`. Then, if building with Python 3 is configured using --extra-python, `planpythontestsuite` will plan an extra Python test for each marked module. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'selftest/selftesthelpers.py')
-rw-r--r--selftest/selftesthelpers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 495a0b7a922..1a1e080b12b 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -46,6 +46,7 @@ else:
has_perl_test_more = False
python = os.getenv("PYTHON", "python")
+extra_python = os.getenv("EXTRA_PYTHON", "python3")
tap2subunit = python + " " + os.path.join(srcdir(), "selftest", "tap2subunit")
@@ -124,7 +125,7 @@ def planperltestsuite(name, path):
skiptestsuite(name, "Test::More not available")
-def planpythontestsuite(env, module, name=None, extra_path=[]):
+def planpythontestsuite(env, module, name=None, extra_path=[], py3_compatible=False):
if name is None:
name = module
pypath = list(extra_path)
@@ -132,6 +133,10 @@ def planpythontestsuite(env, module, name=None, extra_path=[]):
if pypath:
args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath))
plantestsuite_loadlist(name, env, args)
+ if py3_compatible:
+ # Plan one more test for Python 3 compatible module
+ args[0] = extra_python
+ plantestsuite_loadlist(name, env, args)
def get_env_torture_options():