Closed nicoddemus closed 1 year ago
as far as i can tell apiwarn should be removed - it hid bad bugs in pytest for a while and my general eperience with it is shadowed due to that
Should we add a warning about it somewhere then? Removing it is not really productive given that we are keeping some of the modules in py
just with bare maintenance to avoid breaking things that depend on it still (the same reason we didn't remove py.code
for example).
it needs a warning, from what i can tell it also incorrectly invokes the warnings module
I think I am getting the same failure on Gentoo Linux with pytest version 3.2.2:
======================================================= FAILURES =======================================================
_______________________________________________ test_apiwarn_functional ________________________________________________
recwarn = WarningsRecorder(record=True)
def test_apiwarn_functional(recwarn):
capture = py.io.StdCapture()
py.log._apiwarn("x.y.z", "something", stacklevel=1)
out, err = capture.reset()
py.builtin.print_("out", out)
py.builtin.print_("err", err)
> assert err.find("x.y.z") != -1
E AssertionError: assert -1 != -1
E + where -1 = <built-in method find of str object at 0x7f8569bce848>('x.y.z')
E + where <built-in method find of str object at 0x7f8569bce848> = ''.find
testing/log/test_warning.py:26: AssertionError
------------------------------------------------- Captured stdout call ------------------------------------------------$
out
err
i beleive the tests need to be ported to the capsys fixture
The issue is not related to windows at all, the same issue can be observed on linux too. Full log py.txt
apiwarn
seems to conflict with the builtinwarnings
plugin introduced in pytest 3.1.Error log: