diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py index 98be0bccebc7..2959d59c2e46 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/utilities.py @@ -70,7 +70,10 @@ def trim_kwargs_from_test_function(fn, kwargs): # the next function is the actual test function. the kwargs need to be trimmed so # that parameters which are not required will not be passed to it. if not is_preparer_func(fn): - args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method + try: + args, _, kw, _, _, _, _ = inspect.getfullargspec(fn) + except AttributeError: + args, _, kw, _ = inspect.getargspec(fn) # pylint: disable=deprecated-method if kw is None: args = set(args) for key in [k for k in kwargs if k not in args]: