mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 19:32:13 +08:00
Add typestubs for the warnings module (#3543)
This commit is contained in:
committed by
Jelle Zijlstra
parent
0c563130fd
commit
c44a556fb0
@@ -2,6 +2,7 @@ import datetime
|
||||
import logging
|
||||
import sys
|
||||
import unittest.result
|
||||
import warnings
|
||||
from types import TracebackType
|
||||
from typing import (
|
||||
Any, AnyStr, Callable, Container, ContextManager, Dict, FrozenSet, Generic,
|
||||
@@ -233,9 +234,10 @@ class _AssertRaisesContext(Generic[_E]):
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
|
||||
class _AssertWarnsContext:
|
||||
warning: Warning
|
||||
warning: warnings.WarningMessage
|
||||
filename: str
|
||||
lineno: int
|
||||
warnings: List[warnings.WarningMessage]
|
||||
def __enter__(self) -> _AssertWarnsContext: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user