-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new attempt to fic conftest.py after merging
- Loading branch information
1 parent
404421d
commit f72fcf3
Showing
1 changed file
with
0 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,8 @@ | ||
from typing import Any | ||
|
||
import pytest | ||
|
||
from tpcp import BaseTpcpObject | ||
from tpcp._base import _BaseTpcpObject | ||
|
||
|
||
def _get_params_without_nested_class(instance: BaseTpcpObject) -> dict[str, Any]: | ||
return {k: v for k, v in instance.get_params().items() if not isinstance(v, _BaseTpcpObject)} | ||
|
||
|
||
@pytest.fixture() | ||
def snapshot(request): | ||
from tpcp.testing import PyTestSnapshotTest | ||
|
||
with PyTestSnapshotTest(request) as snapshot_test: | ||
yield snapshot_test | ||
|
||
|
||
def pytest_addoption(parser): | ||
group = parser.getgroup("tpcp_snapshots") | ||
group.addoption( | ||
"--snapshot-update", | ||
action="store_true", | ||
default=False, | ||
dest="snapshot_update", | ||
help="Update the snapshots.", | ||
) | ||
group.addoption( | ||
"--snapshot-only-check", | ||
action="store_true", | ||
default=False, | ||
dest="snapshot_only_check", | ||
help="Run as normal, but fail if a snapshot file is not found. This is usefull for CI runs.", | ||
) |