On Tue, Dec 15, 2015 at 14:11 +, Alex Netes wrote:
> > I think you could use a marker on the class or even just a class attribute:
> >
> > import pytest
> >
> > @pytest.fixture(scope="class")
> > def fix(request):
> > return request.cls.attr * 10
> >
> > class TestA:
Hi holger,
Thanks for your help.
> Hi Alex,
>
> On Mon, Dec 14, 2015 at 15:50 +, Alex Netes wrote:
>> Hello guys,
>>
>> I'm new to Pytest and I encounter something I cannot explain.
>
> I also hit many things which i can not explain, even with pytest and maybe
> even with this very mail.
Hi holger,
> Hi Alex,
>
> On Tue, Dec 15, 2015 at 09:18 +, Alex Netes wrote:
> > Hi holger,
> >
> > Thanks for your help.
> >
> > > Hi Alex,
> > >
> > > On Mon, Dec 14, 2015 at 15:50 +, Alex Netes wrote:
> > >> Hello guys,
> > >>
> > >> I'm new to Pytest and I encounter something I
Hi,
Another option is to use fixtures to obtain the values, since fixtures can
be overwritten in subclasses:
import pytest
class Base:
@pytest.fixture(scope='class')
def param(self):
assert 0
@pytest.yield_fixture(scope='class')
def fix(self, param, request):
Hi Alex,
On Mon, Dec 14, 2015 at 15:50 +, Alex Netes wrote:
> Hello guys,
>
> I'm new to Pytest and I encounter something I cannot explain.
I also hit many things which i can not explain, even with pytest
and maybe even with this very mail.
> I'm trying to give fixture fixt_func() a
Hello guys,
I'm new to Pytest and I encounter something I cannot explain.
I'm trying to give fixture fixt_func() a parameter fixt_prm and expect the
fixture to be called only once as it defined with 'class' scope, but the
fixture is called twice as it ignores the scope. What am I missing?