Skip to content

Commit d07e5cd

Browse files
stubs/pyfakef, stubs/pytest_subprocess: Add stubs for test_pci.py
Add stubs which allow using static analysis without import errors. Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
1 parent 537c762 commit d07e5cd

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

stubs/pyfakefs/__init__.pyi

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from _typeshed import Incomplete
2+
Patcher = Incomplete

stubs/pytest_subprocess/__init__.pyi

Whitespace-only changes.
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from .process_recorder import ProcessRecorder as ProcessRecorder
2+
from .types import COMMAND as COMMAND, OPTIONAL_TEXT_OR_ITERABLE as OPTIONAL_TEXT_OR_ITERABLE
3+
from .utils import Any as Any, Command as Command, Program as Program
4+
from _typeshed import Incomplete
5+
from typing import Any as AnyType, Callable, ClassVar, Dict, List, Optional, Type
6+
7+
class FakeProcess:
8+
any: ClassVar[Type[Any]]
9+
program: ClassVar[Type[Program]]
10+
definitions: Incomplete
11+
calls: Incomplete
12+
exceptions: Incomplete
13+
def __init__(self) -> None: ...
14+
def register(
15+
self,
16+
command: COMMAND,
17+
stdout: OPTIONAL_TEXT_OR_ITERABLE = ...,
18+
stderr: OPTIONAL_TEXT_OR_ITERABLE = ...,
19+
returncode: int = ...,
20+
wait: Optional[float] = ...,
21+
# callback: Optional[Callable] = ...,
22+
callback_kwargs: Optional[Dict[str, AnyType]] = ...,
23+
# signal_callback: Optional[Callable] = ...,
24+
occurrences: int = ...,
25+
# stdin_callable: Optional[Callable] = ...,
26+
) -> ProcessRecorder: ...
27+
register_subprocess = register
28+
def pass_command(self, command: COMMAND, occurrences: int = ...) -> None: ...
29+
def __enter__(self) -> "FakeProcess": ...
30+
def __exit__(self, *args: List[Any], **kwargs: Dict[str, Any]) -> None: ...
31+
def allow_unregistered(self, allow: bool) -> None: ...
32+
def call_count(self, command: COMMAND) -> int: ...
33+
def keep_last_process(self, keep: bool) -> None: ...
34+
@classmethod
35+
def context(cls) -> "FakeProcess": ...

0 commit comments

Comments
 (0)