[py-dev] funcarg in a class

holger krekel holger at merlinux.eu
Fri Jan 1 19:37:36 CET 2010


On Thu, Dec 31, 2009 at 17:25 +0000, Joan Miller wrote:
> Is possible to run a funcarg inner of a class? The nex code doesnt works.
> 
> --------------------------
> class TestFoo(object):
> 
>     def pytest_funcarg__myfuncarg(self, request):
>         return 13
> 
> 
>     def test_function(self, append):
>         assert self.myfuncarg == 13

you need to pass in "myfuncarg" instead of "append". 
That should work fine. 

cheers,
holger


More information about the py-dev mailing list