mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-24 20:12:08 +08:00
Correct return type of click.testing.CliRunner.isolation() (#5103)
The method returns a tuple of io.BytesIO objects that hold the temporary stdin and stdout. By correcting the type, it allows usages of io.BytesIO.getvalue() to pass type checking. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from typing import IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, Mapping, Optional, Text, Union
|
||||
import io
|
||||
from typing import IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, Mapping, Optional, Text, Tuple, Union
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .core import BaseCommand
|
||||
|
||||
@@ -53,7 +55,7 @@ class CliRunner:
|
||||
def make_env(self, overrides: Optional[Mapping[str, str]] = ...) -> Dict[str, str]: ...
|
||||
def isolation(
|
||||
self, input: Optional[Union[bytes, Text, IO[Any]]] = ..., env: Optional[Mapping[str, str]] = ..., color: bool = ...
|
||||
) -> ContextManager[BinaryIO]: ...
|
||||
) -> ContextManager[Tuple[io.BytesIO, Union[io.BytesIO, Literal[False]]]]: ...
|
||||
def invoke(
|
||||
self,
|
||||
cli: BaseCommand,
|
||||
|
||||
Reference in New Issue
Block a user