On Jun 10 2016, Florian Bruhin <me-j2duszcpoy900tdglc2...@public.gmane.org> wrote: > * Nikolaus Rath <nikolaus-bth8mxji...@public.gmane.org> [2016-06-10 09:26:34 > -0700]: >> On Jun 10 2016, Florian Bruhin >> <me-j2duszcpoy900tdglc2tyg-xmd5yjdbdmtcbkidbgg...@public.gmane.orgg> wrote: >> > pytest-catchlog >> > [...] >> > - has no way to fail tests on unexpected error logging messages >> >> Agreed. I'm extended it with code like >> https://bitbucket.org/nikratio/python-llfuse/src/tip/test/pytest_checklogs.py, >> but I think there's no way to ever make this pretty without some changes >> to pytest. > > Not to pytest, but to pytest-catchlog I think? > > I haven't taken a closer look at your code yet, but I have something > like this too: > > https://github.com/The-Compiler/qutebrowser/blob/master/tests/helpers/logfail.py > https://github.com/The-Compiler/qutebrowser/blob/master/tests/helpers/test_logfail.py
I'm also checking stdout+stderr output, allow asserting that a log message is generated, and allow registering false positives. That makes the code a little more complicated, and thus it wouldn't be enough to just change pytest-catchlog. Best, -Nikolaus -- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F »Time flies like an arrow, fruit flies like a Banana.«
signature.asc
Description: PGP signature
_______________________________________________ pytest-dev mailing list pytest-dev@python.org https://mail.python.org/mailman/listinfo/pytest-dev