Hi,

On 26 November 2013 18:58, holger krekel <[email protected]> wrote:
> I use flakes and pep8 (pytest-flakes and pytest-pep8) and don't get this
> error.  What you can immediately do but which is not pretty is to use
> the old naming scheme together with a decorator:
>
>     import pytest
>
>     @pytest.fixture
>     def pytest_funcarg__somefixture(...):
>         ...
>
> This should avoid the pylint warning.

Ah, that's cool - I didn't realise that was possible.

However, it doesn't work the way you describe. :) Not sure if your
description or the code is backwards!

At the moment (pytest-2.3.5) if I have two fixtures like this:


@py.test.fixture
def pytest_funcarg__foo2(monkeypatch):
    return monkeypatch


def pytest_funcarg__foo3(monkeypatch):
    return monkeypatch


foo3 works (!). foo2 causes an assertion error on collection.

The code in parsefactories has a couple of if blocks, maybe one is inverted. :)

Don't know if this is a good idea, but you could tell if it was new
style/old style based on if the parameter was 'request' or
nothing/other fixtures.

cheers
Brianna


-- 
They've just been waiting in a mountain for the right moment:
http://modernthings.org/
_______________________________________________
Pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to