You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pytest triggering deprecation warnings in 3.0.5 #2118
/Users/ned/coverage/trunk/.tox/py27/lib/python2.7/site-packages/_pytest/fixtures.py:1071: PendingDeprecationWarning: This usage is deprecated, please use pytest.Class instead
obj = getattr(holderobj, name, None)
/Users/ned/coverage/trunk/.tox/py27/lib/python2.7/site-packages/_pytest/fixtures.py:1071: PendingDeprecationWarning: This usage is deprecated, please use pytest.File instead
obj = getattr(holderobj, name, None)
/Users/ned/coverage/trunk/.tox/py27/lib/python2.7/site-packages/_pytest/fixtures.py:1071: PendingDeprecationWarning: This usage is deprecated, please use pytest.Function instead
obj = getattr(holderobj, name, None)
/Users/ned/coverage/trunk/.tox/py27/lib/python2.7/site-packages/_pytest/fixtures.py:1071: PendingDeprecationWarning: This usage is deprecated, please use pytest.Instance instead
obj = getattr(holderobj, name, None)
/Users/ned/coverage/trunk/.tox/py27/lib/python2.7/site-packages/_pytest/fixtures.py:1071: PendingDeprecationWarning: This usage is deprecated, please use pytest.Item instead
obj = getattr(holderobj, name, None)
/Users/ned/coverage/trunk/.tox/py27/lib/python2.7/site-packages/_pytest/fixtures.py:1071: PendingDeprecationWarning: This usage is deprecated, please use pytest.Module instead
obj = getattr(holderobj, name, None)
i'd rather investigate why we run into those objects, and whether we can avoid the situation to begin with (as we could be hiding other deprecations as well)
A quick test in my tox virtualenv seems to show that the context manager doesn't prevent the warnings..?
BTW, I run my test suite with:
# We want to see all warnings while we are running tests. But we also need to
# disable warnings for some of the more complex setting up of tests.
warnings.simplefilter("default")
# Silence specific warnings that are not our fault.
warnings.filterwarnings("ignore", module="xdist", message="type argument to addoption")
So I try to see warnings, but that last line is to suppress a warning that pytest-xdist causes.
@The-Compiler pendingdeprecations are really silent by default
also while investigating we added pending deprecation in a really bad way
i put a real deprecation there because it should fail hard on this one since a while (namely 2.x)
Wish I'd known about this error before I upgraded pytest to 3.0.5. I don't think that 3.0.5 should be available without this issue resolved. I guess I'm going to figure out how to downgrade my pytest install.
I agree with @nicoddemus (this comment and the following ones) that we should rather revert patch-level deprecations and deprecate things properly for the next feature release.
@The-Compiler the triggering deprecation will be removed, there is an original deprecation that simply doesnt cause warnings that i want to ressurrect at the same time
IMHO just moving the deprecation that was introduced to the features branch is enough, no need to ressurect the other deprecation because I suspect users don't see it anyway.
@nicoddemus both need to be resurrected as they trigger in different usage cases (one happens if attributes on the class dont match the compat property, one triggers when using a compat property in a class declaration)
Activity
RonnyPfannschmidt commentedon Dec 5, 2016
this may prove tricky, it happens in parse_factories
nedbat commentedon Dec 5, 2016
Couldn't you put a "with warnings.catch_warnings():" around line 1071? https://docs.python.org/3/library/warnings.html#temporarily-suppressing-warnings
RonnyPfannschmidt commentedon Dec 5, 2016
i'd rather investigate why we run into those objects, and whether we can avoid the situation to begin with (as we could be hiding other deprecations as well)
nedbat commentedon Dec 5, 2016
A quick test in my tox virtualenv seems to show that the context manager doesn't prevent the warnings..?
BTW, I run my test suite with:
So I try to see warnings, but that last line is to suppress a warning that pytest-xdist causes.
nedbat commentedon Dec 5, 2016
Oops, I hadn't tried catch_warnings correctly. This works, and should only silence this specific warning:
RonnyPfannschmidt commentedon Dec 5, 2016
@nedbat if i recall correctly that operation will reset the once filter cache of the warnings module in various python version
RonnyPfannschmidt commentedon Dec 5, 2016
@nedbat the real bug is, that it tries to operate on a Node object as test object
RonnyPfannschmidt commentedon Dec 5, 2016
@nicoddemus @nedbat the problem lies in
_pytest/python.py:360- getcustomclass triggers thisi will fix this one
The-Compiler commentedon Dec 5, 2016
I can confirm this, breaks my testsuite since I use
-Werror😉Bisected to b38fad4 - cc @nmundar
Blacklist pytest 3.0.5
nicoddemus commentedon Dec 5, 2016
After @RonnyPfannschmidt fixes it, should we do a
3.0.6release or it can wait a few weeks?RonnyPfannschmidt commentedon Dec 5, 2016
@The-Compiler you should never error on pending ones tho ^^
2 remaining items
RonnyPfannschmidt commentedon Dec 6, 2016
@The-Compiler pendingdeprecations are really silent by default
also while investigating we added pending deprecation in a really bad way
i put a real deprecation there because it should fail hard on this one since a while (namely 2.x)
The-Compiler commentedon Dec 6, 2016
DeprecationWarnings are also silent by default 😉Your PR still does
PendingDeprecationWarningthough, right? FWIW I don't think we should change that to aDeprecationWarningwith a patch release.RonnyPfannschmidt commentedon Dec 6, 2016
i still do the pending ones for the old usage site, i changed the other usage side that uses a old api to log the deprecation
rgant commentedon Dec 20, 2016
Wish I'd known about this error before I upgraded pytest to 3.0.5. I don't think that 3.0.5 should be available without this issue resolved. I guess I'm going to figure out how to downgrade my pytest install.
Blacklist pytest 3.0.5
The-Compiler commentedon Jan 20, 2017
I haven't really had time for much pytest work recently, and just happened to rediscover today that I blacklisted pytest 3.0.5 for qutebrowser 😆
Judging from the commits referencing this issue, others did the same - so I think this should really be fixed for a 3.0.6.
RonnyPfannschmidt commentedon Jan 20, 2017
i have a related pr in the work, it will be fixed by
3.0.6The-Compiler commentedon Jan 20, 2017
I agree with @nicoddemus (this comment and the following ones) that we should rather revert patch-level deprecations and deprecate things properly for the next feature release.
RonnyPfannschmidt commentedon Jan 20, 2017
@The-Compiler the triggering deprecation will be removed, there is an original deprecation that simply doesnt cause warnings that i want to ressurrect at the same time
nicoddemus commentedon Jan 20, 2017
IMHO just moving the deprecation that was introduced to the
featuresbranch is enough, no need to ressurect the other deprecation because I suspect users don't see it anyway.RonnyPfannschmidt commentedon Jan 20, 2017
@nicoddemus both need to be resurrected as they trigger in different usage cases (one happens if attributes on the class dont match the compat property, one triggers when using a compat property in a class declaration)
RonnyPfannschmidt commentedon Jan 20, 2017
@nicoddemus oh, and im reasonably sure both will happen in the pypy codebase
nicoddemus commentedon Jan 20, 2017
Oh OK, thanks.
I guess after this is in place we can make a
3.0.6release.Merge pull request #2120 from RonnyPfannschmidt/fix-2118