From c4a60ce94c5aa465fef8764b7fa7c63c44e5e444 Mon Sep 17 00:00:00 2001 From: kasium <15907922+kasium@users.noreply.github.com> Date: Fri, 9 Jul 2021 11:52:22 +0200 Subject: [PATCH] Add pytest-lazyfixture stubs (#5745) This change will add stubs for pytest-lazyfixture. It is particual useful for projects which type their tests and use pytest-lazyfixture. The included functions and classes are the scope which can be considered documented by the module. Any other function is related to pytest hook implementations and are normally not called by an user. Please note, that if a user uses 'pytest.lazy_fixture' these stubs will not work. As recommneded in https://github.com/TvoroG/pytest-lazy-fixture/issues/51 the package needs to imported directly. Co-authored-by: Akuli --- stubs/pytest-lazy-fixture/METADATA.toml | 1 + stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 stubs/pytest-lazy-fixture/METADATA.toml create mode 100644 stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi diff --git a/stubs/pytest-lazy-fixture/METADATA.toml b/stubs/pytest-lazy-fixture/METADATA.toml new file mode 100644 index 000000000000..22cbe4eb9ca3 --- /dev/null +++ b/stubs/pytest-lazy-fixture/METADATA.toml @@ -0,0 +1 @@ +version = "0.6" diff --git a/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi b/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi new file mode 100644 index 000000000000..b5cc42079cb1 --- /dev/null +++ b/stubs/pytest-lazy-fixture/pytest_lazyfixture.pyi @@ -0,0 +1,14 @@ +from typing import Any, Iterable, overload + +class LazyFixture: + name: str + def __init__(self, name: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + +@overload +def lazy_fixture(names: str) -> LazyFixture: ... +@overload +def lazy_fixture(names: Iterable[str]) -> list[LazyFixture] | Any: ... +def is_lazy_fixture(val: Any) -> bool: ... +def pytest_configure() -> None: ... +def __getattr__(name: str) -> Any: ... # incomplete