funcargs should get funcargs as well

Issue #82 wontfix
Ronny Pfannschmidt created an issue

since i work with funcargs more and more i noticed the following pattern emerge

{{{

!python

def pytest_funcarg__foo(request): bar = request.getfuncargvalue('tmpdir') return bar.foo(...)

def pytest_funcarg__bar(request): bar = request.getfuncargvalue('tmpdir') return bar.foo(..., dir=True) }}}

what i would like to see there is: {{{

!python

def pytest_funcarg__foo(tmpdir): return tmpdir.ensure(..., dir=True)

}}}

Comments (1)

  1. Holger Krekel repo owner

    funcargs for funcargs makes the call chain quite complex and tracebacks obscure. Given that getfuncargvalue() does the job and nothing new is possible i think it's not worth it. Rather than this we can think about calling setup methods with the funcarg logic - needs experimentation to see what it conceptually means (request.func would not be there for a call to setup_class and request.class_ would not be there for setup_module. Thus only a subset of funcargs could work for setup_*. Anyway, closing this issue here.

  2. Log in to comment