Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding stubs for pytest-snapshot #13448

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"stubs/pyflakes",
"stubs/Pygments",
"stubs/PyMySQL",
"stubs/pytest-snapshot",
"stubs/python-crontab",
"stubs/python-dateutil",
"stubs/python-http-client",
Expand Down
Empty file.
8 changes: 8 additions & 0 deletions stubs/pytest-snapshot/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version = "0.9.*"
upstream_repository = "https://github.com/joseph-roitman/pytest-snapshot"
requires = []
partial_stub = false

[tool.stubtest]
stubtest_requirements = []
ignore_missing_stub = true
22 changes: 22 additions & 0 deletions stubs/pytest-snapshot/pytest_snapshot/plugin.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from collections.abc import Generator
from pathlib import Path
from types import TracebackType
from typing import Any

import pytest

Check failure on line 6 in stubs/pytest-snapshot/pytest_snapshot/plugin.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Import "pytest" could not be resolved (reportMissingImports)

@pytest.fixture

Check failure on line 8 in stubs/pytest-snapshot/pytest_snapshot/plugin.pyi

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Untyped function decorator obscures type of function; ignoring decorator (reportUntypedFunctionDecorator)
def snapshot(request: pytest.FixtureRequest) -> Generator[Snapshot, Any, None]: ...

class Snapshot:
def __init__(self, snapshot_update: bool, allow_snapshot_deletion: bool, snapshot_dir: Path): ...
def __enter__(self): ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
@property
def snapshot_dir(self) -> Path: ...
@snapshot_dir.setter
def snapshot_dir(self, value: str | Path) -> None: ...
def assert_match(self, value: str | bytes, snapshot_name: str | Path) -> None: ...
def assert_match_dir(self, dir_dict: dict[Any, Any], snapshot_dir_name: str | Path) -> None: ...
Loading