Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return b
def expected_pinned_func():
c = 4
print(str(10) + str(c))
return 11
with pytest.raises(TypeError):
inliner.pin_arguments(func, dict(a=1))
with pytest.raises(TypeError):
inliner.pin_arguments(func, dict(a=1, b=2, c=3))
pinned_func = inliner.pin_arguments(func, dict(a=10, b=11))
assert inliner.are_functions_equivalent(pinned_func, expected_pinned_func)
def test_pin_arguments():
def func(a, b):
c = 4
print(str(a) + str(c))
return b
def expected_pinned_func():
c = 4
print(str(10) + str(c))
return 11
with pytest.raises(TypeError):
inliner.pin_arguments(func, dict(a=1))
with pytest.raises(TypeError):
inliner.pin_arguments(func, dict(a=1, b=2, c=3))
pinned_func = inliner.pin_arguments(func, dict(a=10, b=11))
assert inliner.are_functions_equivalent(pinned_func, expected_pinned_func)