not sure how you build call , but if it's some kind of args :
# IN THE CASE WE'RE DOING call(*args) if all([len(args) == 4,isinstance(args[0],str), isinstance(args[1],str), hasattr(args[2],'__call__'), isinstance(args[3],int)]): # PASS else: # FAIL
If you are overly concerned about getting input that is callable, which is NOT a function, and feel that it will fail the unit test:
from types import FunctionType isinstance(lambda x: x,FunctionType)
source share