Skip to content

Commit

Permalink
new attempt to fic conftest.py after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mosquito authored and AKuederle committed Jun 28, 2024
1 parent 404421d commit f72fcf3
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tests/conftest.py
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.",
)

0 comments on commit f72fcf3

Please sign in to comment.