New submission from Kit Yan Choi <k...@kychoi.org>:

assertLogs is really useful (issue18937). Unfortunately it does not cover the 
use cases where one wants to ensure no logs are emitted.

Similar to assertLogs, we can have a context manager for asserting no logs, 
something like this?:

with assertNoLogs(logger, level):
    ...


If logs are unexpected found, the test would fail with the logs captured 
included in the error message.

Happy to submit a PR if there is interest.

----------
components: Library (Lib)
messages: 360250
nosy: Kit Yan Choi
priority: normal
severity: normal
status: open
title: Add an assertNoLogs context manager to unittest TestCase
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to