File: _log.pyi

package info (click to toggle)
typeshed 0.0~git20241223.ea91db2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 28,756 kB
  • sloc: python: 7,741; makefile: 20; sh: 18
file content (27 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import logging
import sys
from types import TracebackType
from typing import ClassVar, Generic, NamedTuple, TypeVar
from unittest.case import TestCase, _BaseTestCaseContext

_L = TypeVar("_L", None, _LoggingWatcher)

class _LoggingWatcher(NamedTuple):
    records: list[logging.LogRecord]
    output: list[str]

class _AssertLogsContext(_BaseTestCaseContext, Generic[_L]):
    LOGGING_FORMAT: ClassVar[str]
    logger_name: str
    level: int
    msg: None
    if sys.version_info >= (3, 10):
        def __init__(self, test_case: TestCase, logger_name: str, level: int, no_logs: bool) -> None: ...
        no_logs: bool
    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_value: BaseException | None, tb: TracebackType | None
    ) -> bool | None: ...