diff options
author | Zac Hatfield-Dodds <Zac-HD@users.noreply.github.com> | 2019-06-25 13:06:02 +1000 |
---|---|---|
committer | Zac-HD <zac.hatfield.dodds@gmail.com> | 2019-06-26 08:53:17 +1000 |
commit | ed85c831548f4bae256b9ce90973ab74bf95c59f (patch) | |
tree | 67c54a5c55fdb6ae0057e2980da4ec7a2f00a36f /src | |
parent | 64a63652278d43b99aec5b5a3f36afd220b01f90 (diff) | |
download | pytest-ed85c831548f4bae256b9ce90973ab74bf95c59f.tar.gz |
Deprecate funcargnames alias
Diffstat (limited to 'src')
-rw-r--r-- | src/_pytest/compat.py | 4 | ||||
-rw-r--r-- | src/_pytest/deprecated.py | 5 | ||||
-rw-r--r-- | src/_pytest/fixtures.py | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 2c964f473..d238061b4 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -325,4 +325,8 @@ class FuncargnamesCompatAttr: @property def funcargnames(self): """ alias attribute for ``fixturenames`` for pre-2.3 compatibility""" + import warnings + from _pytest.deprecated import FUNCARGNAMES + + warnings.warn(FUNCARGNAMES, stacklevel=2) return self.fixturenames diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 1c544fd36..e31b9eb0e 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -40,6 +40,11 @@ GETFUNCARGVALUE = RemovedInPytest4Warning( "getfuncargvalue is deprecated, use getfixturevalue" ) +FUNCARGNAMES = PytestDeprecationWarning( + "The `funcargnames` attribute was an alias for `fixturenames`, " + "since pytest 2.3 - use the newer attribute instead." +) + RAISES_MESSAGE_PARAMETER = PytestDeprecationWarning( "The 'message' parameter is deprecated.\n" "(did you mean to use `match='some regex'` to check the exception message?)\n" diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 0a792d11d..3262b65bb 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -654,7 +654,7 @@ class SubRequest(FixtureRequest): # if the executing fixturedef was not explicitly requested in the argument list (via # getfixturevalue inside the fixture call) then ensure this fixture def will be finished # first - if fixturedef.argname not in self.funcargnames: + if fixturedef.argname not in self.fixturenames: fixturedef.addfinalizer( functools.partial(self._fixturedef.finish, request=self) ) |