Fixed#2684: use the correct stacklevel for deprecation warnings#2689
Fixed#2684: use the correct stacklevel for deprecation warnings#2689srinivasreddy wants to merge 1 commit intopytest-dev:masterfrom srinivasreddy:2684
Conversation
| 'pytest now uses argparse. "%default" should be' | ||
| ' changed to "%(default)s" ', | ||
| DeprecationWarning, | ||
| stacklevel=3) |
There was a problem hiding this comment.
this change looks incorrect, the argument type is used indirectly and the higher level intended to trigger that warning for the method call side
| msg = "Raised while trying to determine id of parameter %s at position %d." % (argname, idx) | ||
| msg += '\nUpdate your code as this will raise an error in pytest-4.0.' | ||
| warnings.warn(msg, DeprecationWarning) | ||
| warnings.warn(msg, DeprecationWarning, stacklevel=2) |
There was a problem hiding this comment.
for this one stacklevel is actually not applicable
|
|
||
| if newmarks: | ||
| warnings.warn(MARK_PARAMETERSET_UNPACKING) | ||
| warnings.warn(MARK_PARAMETERSET_UNPACKING, stacklevel=2) |
There was a problem hiding this comment.
in this case stacklevel is also not usable, its a case where its probably more sensible to warn explicit and pass the test around
|
i should have been more clear with what i meant by review, because simply setting |
|
I agree, unfortunately a few of those will need to use |
|
I am closing this. |
|
Thanks anyway for the effort @srinivasreddy, we appreciate it! 👍 |
No description provided.