@@ -950,6 +950,9 @@ Test cases
950950 | :meth: `assertLogs(logger, level) | The ``with `` block logs on *logger * | 3.4 |
951951 | <TestCase.assertLogs>` | with minimum *level * | |
952952 +---------------------------------------------------------+--------------------------------------+------------+
953+ | :meth: `assertNoLogs(logger, level) | The ``with `` block does not log on | 3.10 |
954+ | <TestCase.assertNoLogs>` | *logger * with minimum *level * | |
955+ +---------------------------------------------------------+--------------------------------------+------------+
953956
954957 .. method :: assertRaises(exception, callable, *args, **kwds)
955958 assertRaises(exception, *, msg=None)
@@ -1121,6 +1124,24 @@ Test cases
11211124
11221125 .. versionadded :: 3.4
11231126
1127+ .. method :: assertNoLogs(logger=None, level=None)
1128+
1129+ A context manager to test that no messages are logged on
1130+ the *logger * or one of its children, with at least the given
1131+ *level *.
1132+
1133+ If given, *logger * should be a :class: `logging.Logger ` object or a
1134+ :class: `str ` giving the name of a logger. The default is the root
1135+ logger, which will catch all messages.
1136+
1137+ If given, *level * should be either a numeric logging level or
1138+ its string equivalent (for example either ``"ERROR" `` or
1139+ :attr: `logging.ERROR `). The default is :attr: `logging.INFO `.
1140+
1141+ Unlike :meth: `assertLogs `, nothing will be returned by the context
1142+ manager.
1143+
1144+ .. versionadded :: 3.10
11241145
11251146 There are also other methods used to perform more specific checks, such as:
11261147
0 commit comments