From 971908ca242c5302fad6ac9cfaa1c3dbb558956e Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sun, 28 Nov 2021 13:25:43 +0000 Subject: [PATCH] Add `no_logs` parameter to `AssertLogsContext` (#6426) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- stdlib/unittest/case.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index c63b94396..9bcd2c05a 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -278,7 +278,10 @@ class _AssertLogsContext(Generic[_L]): LOGGING_FORMAT: str records: list[logging.LogRecord] output: list[str] - def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... + if sys.version_info >= (3, 10): + def __init__(self, test_case: TestCase, logger_name: str, level: int, no_logs: bool) -> None: ... + else: + def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... def __enter__(self) -> _L: ... def __exit__( self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None