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

selftest: add option to pass args to tests to planpythontestsuite()

The logic is basically a copy from planoldpythontestsuite().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Björn Baumbach <bb@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Björn Baumbach 2020-07-24 12:18:11 +02:00 committed by Stefan Metzmacher
parent 0133c17c09
commit 3e9f0e9725

View File

@ -135,16 +135,18 @@ def planperltestsuite(name, path):
skiptestsuite(name, "Test::More not available")
def planpythontestsuite(env, module, name=None, extra_path=None):
def planpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[]):
environ = dict(environ)
py_path = list(extra_path)
if py_path is not None:
environ["PYTHONPATH"] = ":".join(["$PYTHONPATH"] + py_path)
args = ["%s=%s" % item for item in environ.items()]
args += [python, "-m", "samba.subunit.run", "$LISTOPT", "$LOADLIST", module]
args += extra_args
if name is None:
name = module
args = [python, "-m", "samba.subunit.run", "$LISTOPT", "$LOADLIST", module]
if extra_path:
pypath = ["PYTHONPATH=$PYTHONPATH:%s" % ":".join(extra_path)]
else:
pypath = []
plantestsuite_loadlist(name, env, pypath + args)
plantestsuite_loadlist(name, env, args)
def get_env_torture_options():