def test_function_type_inference(): expected = (Number, str) inferred = adapter.infer(format_number) assert inferred == expected assert isinstance(inferred, adapter.Adaptation)
def test_callable_type_inference(numformatter): expected = (Number, str) inferred = adapter.infer(numformatter) assert inferred == expected assert isinstance(inferred, adapter.Adaptation)
def test_method_type_inference(numformatter): expected = (Number, str) inferred = adapter.infer(numformatter.percentage) assert inferred == expected assert isinstance(inferred, adapter.Adaptation)
def test_class_type_inference(): expected = (str, StringIO) inferred = adapter.infer(StringIO) assert inferred == expected assert isinstance(inferred, adapter.Adaptation)