1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

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>
This commit is contained in:
Lumir Balhar 2016-10-19 20:51:47 +02:00 committed by Andrew Bartlett
parent 358eaf810e
commit 8f8b0fd12a

View File

@ -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():