[py-dev] Decorators and funcargs in py.test
rafalskiy at gmail.com
Mon May 30 21:17:32 CEST 2011
I am trying to make decorators work with test functions, which depend
on funcargs. As it stands, they don't.
Decorated functions lose funcargs. A workaround would be to decorate
an internal function like this:
# test it
This works, but it is not nice. I'd rather wrote a decorator like
def _wrap_it(*args, **kwargs):
# wrap f() here
_wrap_it._varnames = _pytest.core.varnames(f)
and apply it straight to the test function.
After examining the source code I even expected it to just work
(magically of course) but it didn't.
Do you think it is worthwhile? If so I can enter a feature request.
More information about the Pytest-dev