-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding stubs for pytest-snapshot #13448
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
base: main
Are you sure you want to change the base?
Changes from all commits
7e4cd20
8035df2
bc4608e
7ffdf2a
04bfad1
5401a98
b609507
4c8393b
a23dbd1
260951e
62ae393
9cf47ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| version = "0.9.*" | ||
| upstream_repository = "https://github.com/joseph-roitman/pytest-snapshot" | ||
| requires = ["pytest"] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||
| import re | ||||||
| from collections.abc import Generator | ||||||
| from pathlib import Path | ||||||
| from types import TracebackType | ||||||
| from typing import Any | ||||||
|
|
||||||
| import _pytest.config.argparsing | ||||||
| import pytest | ||||||
|
|
||||||
| PARAMETRIZED_TEST_REGEX: re.Pattern[str] | ||||||
|
|
||||||
| def pytest_addoption(parser: _pytest.config.argparsing.Parser) -> None: ... | ||||||
| @pytest.fixture | ||||||
| def snapshot(request: pytest.FixtureRequest) -> Generator[Snapshot, Any, None]: ... | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually use |
||||||
|
|
||||||
| class Snapshot: | ||||||
| def __init__(self, snapshot_update: bool, allow_snapshot_deletion: bool, snapshot_dir: Path): ... | ||||||
| def __enter__(self): ... | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
( |
||||||
| 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: ... | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now require each use of |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
Finalneeds to be imported fromtyping.