def test(func: callable, params, expected_value, title: str, description = None): print(title, end=" ") value = func(*params) if (value == expected_value): print("[OK]") return print ("[ERROR]") print ("expected", expected_value, ", got", value) if not description is None: print (description)