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