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
Closed

Deprecate "pytest_funcarg__" prefix for fixtures #1684

nicoddemus opened this issue Jun 27, 2016 · 14 comments
Labels
type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Milestone

Comments

@nicoddemus
Copy link
Member

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 the type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature label Jun 27, 2016
@nicoddemus nicoddemus added this to the 3.0 milestone Jun 27, 2016
@nicoddemus
Copy link
Member Author

cc @obestwalter

@nicoddemus
Copy link
Member Author

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

@RonnyPfannschmidt
Copy link
Member

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

@obestwalter
Copy link
Member

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
Copy link
Member Author

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

@RonnyPfannschmidt
Copy link
Member

RonnyPfannschmidt commented Jul 12, 2016

done in #1714

@jsn1993
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
Copy link
Member Author

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
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
cclauss added a commit to internetarchive/openlibrary that referenced this issue Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

7 participants