Skip to content

Commit

Permalink
Add pytest-lazyfixture stubs (#5745)
Browse files Browse the repository at this point in the history
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 TvoroG/pytest-lazy-fixture#51 the package needs to imported directly.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
  • Loading branch information
kasium and Akuli committed Jul 9, 2021
1 parent aca5952 commit c4a60ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions stubs/pytest-lazy-fixture/METADATA.toml
@@ -0,0 +1 @@
version = "0.6"
14 changes: 14 additions & 0 deletions 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

0 comments on commit c4a60ce

Please sign in to comment.