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

selftest: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
This commit is contained in:
Rob van der Linde 2023-02-23 15:51:48 +13:00 committed by Andrew Bartlett
parent f582caad83
commit 4717a58f6c

View File

@ -66,13 +66,15 @@ def valgrindify(cmdline):
return valgrind + " " + cmdline return valgrind + " " + cmdline
def plantestsuite(name, env, cmd, environ={}): def plantestsuite(name, env, cmd, environ=None):
"""Plan a test suite. """Plan a test suite.
:param name: Testsuite name :param name: Testsuite name
:param env: Environment to run the testsuite in :param env: Environment to run the testsuite in
:param cmdline: Command line to run :param cmdline: Command line to run
""" """
if environ is None:
environ = {}
print("-- TEST --") print("-- TEST --")
if env == "none": if env == "none":
fullname = name fullname = name
@ -149,7 +151,13 @@ def planperltestsuite(name, path):
skiptestsuite(name, "Test::More not available") skiptestsuite(name, "Test::More not available")
def planpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[]): def planpythontestsuite(env, module, name=None, extra_path=None, environ=None, extra_args=None):
if extra_path is None:
extra_path = []
if environ is None:
environ = {}
if extra_args is None:
extra_args = []
environ = dict(environ) environ = dict(environ)
py_path = list(extra_path) py_path = list(extra_path)
if py_path is not None: if py_path is not None:
@ -192,7 +200,9 @@ smbtorture4_options = [
] + get_env_torture_options() ] + get_env_torture_options()
def plansmbtorture4testsuite(name, env, options, target, modname=None, environ={}): def plansmbtorture4testsuite(name, env, options, target, modname=None, environ=None):
if environ is None:
environ = {}
if modname is None: if modname is None:
modname = "samba4.%s" % name modname = "samba4.%s" % name
if isinstance(options, list): if isinstance(options, list):