Tests and logging - pytest-capturelog

Mads Kiilerich mads at kiilerich.com
Mon Jun 13 13:08:41 UTC 2016


On 05/29/2016 09:11 PM, Thomas De Schampheleire wrote:
> On Tue, May 24, 2016 at 9:13 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
>> Hi
>>
>> Writing or debugging Kallithea tests can be frustrating. One reason is that
>> there is no logging (AFAICS).
>>
>> I just found
>>
>> pip install pytest-capturelog
>>
>> which will make log output show up for failing tests. That seems to be very
>> helpful! (It would perhaps be even more helpful if it showed up interleaved
>> with stdout output ... but that is no big deal.)
>>
>> Does this trick work for you too? Or do you have other similar tricks?
> Works for me, nice find! I'd say: add it to the requirements.

Hmm ... 
https://bitbucket.org/memedough/pytest-capturelog/issues/6/__multicall__-deprecated-in-upcoming 
suggests we should use pytest-catchlog instead ...

>
> In the current turbogears situation I had disabled all logging, as
> there were some database logs that kept appearing and I did not find
> how to silence them (and the actual test logs were not shown anyway).
> I need to disable that disabling to benefit from pytest-capturelog, so
> I'll need to find another solution for the annoying logs. More on that
> later...

It wasn't covered by test.ini setting [logger_sqlalchemy] level = ERROR ?


/Mads


More information about the kallithea-general mailing list