pytest-dev / py

Python development support library (note: maintenance only)
MIT License
67 stars 106 forks source link

PyStdIsDeprecatedWarning doesnt show the caller line #227

Closed jayvdb closed 4 years ago

jayvdb commented 4 years ago

The output of this is like:

/usr/lib/python3.7/site-packages/py/_std.py:19: PyStdIsDeprecatedWarning: py.std is deprecated, plase import _pytestfixturefunction directly
  category=PyStdIsDeprecatedWarning)

It should instead show the line of the caller, not the line of the warning invocation.

jayvdb commented 4 years ago

Worth noting that I am currently seeing it occurring at https://github.com/pytest-dev/pytest/blob/e3ac44d/src/_pytest/fixtures.py#L173