From 58036d463d28a26b60bb221bbf9c93859b51baea Mon Sep 17 00:00:00 2001 From: Benjamin Wohlwend Date: Thu, 10 Jun 2021 09:34:54 +0200 Subject: [PATCH] updated type hints for caplog.at_level to match caplog.set_level The underlying logging API accepts the log level both as int and as string. --- src/_pytest/logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index da1de013d..4ab7b5e97 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -451,7 +451,7 @@ class LogCaptureFixture: @contextmanager def at_level( - self, level: int, logger: Optional[str] = None + self, level: Union[int, str], logger: Optional[str] = None ) -> Generator[None, None, None]: """Context manager that sets the level for capturing of logs. After the end of the 'with' statement the level is restored to its original