diff --git a/AUTHORS b/AUTHORS index 42936552f..ee4ef203f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -377,6 +377,7 @@ Victor Maryama Victor Rodriguez Victor Uriarte Vidar T. Fauske +Vijay Arora Virgil Dupras Vitaly Lashmanov Vivaan Verma diff --git a/changelog/9146.doc.rst b/changelog/9146.doc.rst new file mode 100644 index 000000000..95189b96d --- /dev/null +++ b/changelog/9146.doc.rst @@ -0,0 +1 @@ +Improve Documentation for `caplog.set_level`. diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 6381e86b0..838134660 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -515,7 +515,9 @@ class LogCaptureFixture: return original_disable_level def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> None: - """Set the level of a logger for the duration of a test. + """Set the threshold level of a logger for the duration of a test. + + Logging messages which are less severe than this level will not be captured. .. versionchanged:: 3.4 The levels of the loggers changed by this function will be