[pytest-dev] fixtures and pylint W0621
brianna.laugher at gmail.com
Wed Dec 4 03:29:10 CET 2013
On 3 December 2013 18:39, holger krekel <holger at merlinux.eu> wrote:
> Right, it seems that when we introduced @pytest.fixture we decided you can
> either use the prefix or the marker. That could be lifted but i wonder
> if we should rather go for a different convention because pytest_funcarg__
> is not a beautiful prefix. What do you think of pytest stripping the "__" prefix?
> def __foo2(monkeypatch):
> return monkeypatch
> This fixture would become accessible via the "foo2" name. Using "__foo2"
> would yield a lookup error and the error would indicate there is a "foo2"
> available. If you don't like it, any other suggestions?
Hmm. My main concern here would be that fixture definitions are easily
'findable' in a global search. The fixture decorator is easy to search
for, as is 'pytest_funcarg__'. Such an ugly prefix is also far easier
to google. Double underscore, not so much. The ugly prefix is also
good for backwards compat.
So, I don't really mind what happens as long as each fixture has at
least one of fixture decorator/ugly prefix.
They've just been waiting in a mountain for the right moment:
More information about the Pytest-dev