Closed
Description
Originally reported by: David MacIver (BitBucket: david_maciver_, GitHub: david_maciver_)
#!python
from functools import wraps
def add_default(f):
@wraps(f)
def hello(x=1):
return f(x)
return hello
@add_default
def test_hello(x):
assert x == 1
In python 2 the addition of the default works: The test is called with x=1. In python 3 this looks for a fixture and errors with fixture 'x' not found.
Additionally, if I remove the wraps this works in both versions.
I'm not sure what the intended correct behaviour is, but having the behaviour be different between 2 or 3 sounds like a bug regardless of which one is correct.