Merge pull request #9149 from Vijay-Arora/main

This commit is contained in:
Zac Hatfield-Dodds 2023-06-19 20:35:01 -07:00 committed by GitHub
commit b5ec092525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -377,6 +377,7 @@ Victor Maryama
Victor Rodriguez
Victor Uriarte
Vidar T. Fauske
Vijay Arora
Virgil Dupras
Vitaly Lashmanov
Vivaan Verma

1
changelog/9146.doc.rst Normal file
View File

@ -0,0 +1 @@
Improve Documentation for `caplog.set_level`.

View File

@ -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