[py-dev] funcarg in a class

Joan Miller peloko45 at gmail.com
Fri Jan 1 23:58:11 CET 2010


Thanks! I could solve it after of having written to the mailing list.
Sometimes the things go out when you make something in the background.

Happy new year!

2010/1/1 holger krekel <holger at merlinux.eu>:
> On Fri, Jan 01, 2010 at 19:37 +0100, holger krekel wrote:
>> 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.
>
> to be precise:
>
>    def test_function(self, myfuncarg):
>        assert myfuncarg == 13
>
> should work.  or do you mean something else?
>
> cheers and happy new year!
> holger
>



More information about the Pytest-dev mailing list