Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate "pytest_funcarg__" prefix for fixtures #1684

Closed
nicoddemus opened this Issue Jun 27, 2016 · 14 comments

Comments

Projects
None yet
7 participants
@nicoddemus
Copy link
Member

nicoddemus commented Jun 27, 2016

Start to issue deprecation warnings when fixtures are declared using this legacy idiom, to be removed at some point later in time.

@nicoddemus nicoddemus added this to the 3.0 milestone Jun 27, 2016

@nicoddemus

This comment has been minimized.

Copy link
Member Author

nicoddemus commented Jun 27, 2016

@nicoddemus

This comment has been minimized.

Copy link
Member Author

nicoddemus commented Jun 27, 2016

Not sure if it's worth, as keeping support for this old form is simple enough too

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

RonnyPfannschmidt commented Jun 27, 2016

i want to see this removed :) it complicates things as its not sanely layered

@obestwalter

This comment has been minimized.

Copy link
Member

obestwalter commented Jun 29, 2016

It's not explicitly deprecated yet. Shall we add a deprecation warning before 3.0? I just grepped through the code and there are loads of tests using it. Updating those tests to use the fixture decorator would be a nice low hanging fruit task.

@nicoddemus

This comment has been minimized.

Copy link
Member Author

nicoddemus commented Jun 29, 2016

OK, I think we should introduce a deprecation warning for 3.0 then. Added it to the Wiki.

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

RonnyPfannschmidt commented Jul 12, 2016

done in #1714

@jsn1993

This comment has been minimized.

Copy link

jsn1993 commented Aug 24, 2016

For pytest_funcargs__, what is the alternative approach? Since some legacy code have this and I'm new to py.test.

@nicoddemus

This comment has been minimized.

Copy link
Member Author

nicoddemus commented Aug 25, 2016

Just replace this:

def pytest_funcargs__hello():
    ...

with:

@pytest.fixture
def hello():
    ...

😉

opennao pushed a commit to aldebaran/qibuild that referenced this issue Feb 5, 2018

[#2] Suppress warning about pytest_funcarg__cov
Warning below was fixed in pytest-cov 2.3.1:
see details on pytest-dev/pytest#1684

pytest_funcarg__cov: declaring fixtures using "pytest_funcarg__" prefix is deprecated and scheduled to be removed in pytest 4.0.  Please remove the prefix and use the @pytest.fixture decorator instead.

Change-Id: Id8565778485eb502ef72b0635dfa222532de8dc6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.