How can I pass a function as a parameter in Python? I want to do something like the code below.
My goal is to pass different parameters to test a single function.
def __internal_function(inputs):
a,b,c,d = inputs
new_value_of_b = copy.deepcopy(b)
name = b['name']
age = b['age']
weight = b['weight']
height = b['height']
new_value_of_b2 = [name, age, weight, height]
new_value_of_b3= new_value_of_b['weight']['unit'] = 'cm'
del new_value_of_b['age']
return new_value_of_b,new_value_of_b2,new_value_of_b3
@pytest.mark.parametrize('values',__internal_function,'expected_code',[100,200,300])
assert func(__internal_function)== expected_code