[pytest-dev] My gripes with pytest and tox

Nikolaus Rath Nikolaus at rath.org
Fri Jun 10 18:29:35 EDT 2016


On Jun 10 2016, Florian Bruhin <me-J2duszcpOy900TDglC2tyg at public.gmane.org> wrote:
> * Nikolaus Rath <Nikolaus-BTH8mxji4b0 at public.gmane.org> [2016-06-10 09:26:34 -0700]:
>> On Jun 10 2016, Florian Bruhin <me-J2duszcpOy900TDglC2tyg-XMD5yJDbdMTcBkidbGgD4Q at 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.«
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 997 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160610/dba7ca00/attachment-0001.sig>


More information about the pytest-dev mailing list