mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Add _typeshed.(Opt)ExcInfo (#7645)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import types
|
||||
import unittest
|
||||
from _typeshed import ExcInfo
|
||||
from typing import Any, Callable, NamedTuple
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
@@ -125,7 +126,6 @@ class DocTestFinder:
|
||||
) -> list[DocTest]: ...
|
||||
|
||||
_Out: TypeAlias = Callable[[str], Any]
|
||||
_ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, types.TracebackType]
|
||||
|
||||
class DocTestRunner:
|
||||
DIVIDER: str
|
||||
@@ -138,7 +138,7 @@ class DocTestRunner:
|
||||
def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ...
|
||||
def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ...
|
||||
def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ...
|
||||
def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ...
|
||||
def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: ExcInfo) -> None: ...
|
||||
def run(
|
||||
self, test: DocTest, compileflags: int | None = ..., out: _Out | None = ..., clear_globs: bool = ...
|
||||
) -> TestResults: ...
|
||||
@@ -158,8 +158,8 @@ class DocTestFailure(Exception):
|
||||
class UnexpectedException(Exception):
|
||||
test: DocTest
|
||||
example: Example
|
||||
exc_info: _ExcInfo
|
||||
def __init__(self, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ...
|
||||
exc_info: ExcInfo
|
||||
def __init__(self, test: DocTest, example: Example, exc_info: ExcInfo) -> None: ...
|
||||
|
||||
class DebugRunner(DocTestRunner): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user