Pytest: warning filters incorrectly apply for conftests and collection in pytester

Created on 18 Aug 2017  路  2Comments  路  Source: pytest-dev/pytest

2696 uncovered that pytest invocations with selected warning filters dont pass trough to the nested pytest correctly, in turn making tests even with the filter fail at importing a conftest and running a collection

CC @nicoddemus

warnings bug

Most helpful comment

@jbasko thanks for the ping on this. This will be fixed by #4164. 馃憤

All 2 comments

Is this why I am getting lots of warnings when testing a plugin I've written? --

lib/python3.5/site-packages/_pytest/compat.py:321: RemovedInPytest4Warning: usage of Session.Item is deprecated, please use pytest.Item instead

but I can't find any place where I use session.<something>.

If I remove pytester plugin then everything that depends on it fails of course, but I don't get any of these warnings.

When I install the plugin in a user code project which just runs pytest with my plugin then I don't see these warnings.

I'm on:
pytest=3.9.1
Python 3.5.6

@jbasko thanks for the ping on this. This will be fixed by #4164. 馃憤

Was this page helpful?
0 / 5 - 0 ratings