Verified Commit b2fee3a6 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Restore behave-stubs

The stubs are included in the package, but can now be considered deprecated.
parent 54b67e7f
Loading
Loading
Loading
Loading
Loading
+1
Changes for stubs/behave: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
behave-stubs
 No newline at end of file
+30
Changes for stubs/behave-stubs/__init__.pyi: 30 added lines, 0 removed lines.
Original line number Diff line number Diff line
from .fixture import fixture
from .fixture import use_fixture
from .matchers import register_type
from .matchers import use_step_matcher
from .step_registry import Given
from .step_registry import Step
from .step_registry import Then
from .step_registry import When
from .step_registry import given
from .step_registry import step
from .step_registry import then
from .step_registry import when

# .matchers.step_matcher is deprecated, not including

__version__: str
__all__ = [
	"Given",
	"Step",
	"Then",
	"When",
	"fixture",
	"given",
	"register_type",
	"step",
	"then",
	"use_fixture",
	"use_step_matcher",
	"when",
]
+43
Changes for stubs/behave-stubs/capture.pyi: 43 added lines, 0 removed lines.
Original line number Diff line number Diff line
from io import StringIO
from typing import IO

from .log_capture import LoggingCapture
from .model import Configuration
from .runner import Context

class Captured:

	stdout: str
	stderr: str
	log_output: str

	@property
	def output(self) -> str: ...

	def __init__(self, stdout: str = ..., stderr: str = ..., log_output: str = ...) -> None: ...
	def __add__(self, other: Captured) -> Captured: ...

	def reset(self) -> None: ...
	def add(self, captured: Captured) -> Captured: ...
	def make_report(self) -> str: ...


class CaptureController:

	config: Configuration
	stdout_capture: StringIO
	stderr_capture: StringIO
	log_capture: LoggingCapture
	old_stdout: IO[str]
	old_stderr: IO[str]

	@property
	def capture(self) -> Captured: ...

	def __init__(self, config: Configuration) -> None: ...

	def setup_capture(self, context: Context) -> None: ...
	def start_capture(self) -> None: ...
	def stop_capture(self) -> None: ...
	def teardown_capture(self) -> None: ...
	def make_capture_report(self) -> str: ...
+44
Changes for stubs/behave-stubs/fixture.pyi: 44 added lines, 0 removed lines.
Original line number Diff line number Diff line
from collections.abc import Callable
from collections.abc import Iterator
from typing import Concatenate
from typing import TypeVar
from typing import overload

from typing_extensions import ParamSpec

from .runner import Context

ContextT = TypeVar("ContextT", bound=Context, contravariant=True)
ReturnT = TypeVar("ReturnT", covariant=True)
Params = ParamSpec("Params")


@overload
def use_fixture(
	fixture_func: Callable[Concatenate[ContextT, Params], Iterator[ReturnT]],
	context: ContextT,
	*args: Params.args,
	**kwargs: Params.kwargs,
) -> ReturnT: ...

@overload
def use_fixture(
	fixture_func: Callable[Concatenate[ContextT, Params], ReturnT],
	context: ContextT,
	*args: Params.args,
	**kwargs: Params.kwargs,
) -> ReturnT: ...


@overload
def fixture(
	func: Callable[Params, ReturnT],
	name: str = ...,
	pattern: str = ...,
) -> Callable[Params, ReturnT]: ...

@overload
def fixture(
	name: str = ...,
	pattern: str = ...,
) -> Callable[[Callable[Params, ReturnT]], Callable[Params, ReturnT]]: ...

Empty file added.

Loading