# Path: snapshottest/pytest.py
# class PyTestSnapshotTest(SnapshotTest):
#     def __init__(self, request=None):
#         self.request = request
#         super(PyTestSnapshotTest, self).__init__()
# 
#     @property
#     def module(self):
#         return SnapshotModule.get_module_for_testpath(self.request.node.fspath.strpath)
# 
#     @property
#     def update(self):
#         return self.request.config.option.snapshot_update
# 
#     @property
#     def test_name(self):
#         cls_name = getattr(self.request.node.cls, "__name__", "")
#         flattened_node_name = re.sub(
#             r"\s+", " ", self.request.node.name.replace(r"\n", " ")
#         )
#         return "{}{} {}".format(
#             "{}.".format(cls_name) if cls_name else "",
#             flattened_node_name,
#             self.curr_snapshot,
#         )


import pytest
from snapshottest.pytest import PyTestSnapshotTest



@pytest.fixture
def options():
    return {}


@pytest.fixture
def _apply_options(request, monkeypatch, options):
    for k, v in options.items():
        monkeypatch.setattr(request.config, k, v, raising=False)


@pytest.fixture
def pytest_snapshot_test(request, _apply_options):

# Path: snapshottest/pytest.py
# class PyTestSnapshotTest(SnapshotTest):
#     def __init__(self, request=None):
#         self.request = request
#         super(PyTestSnapshotTest, self).__init__()
# 
#     @property
#     def module(self):
#         return SnapshotModule.get_module_for_testpath(self.request.node.fspath.strpath)
# 
#     @property
#     def update(self):
#         return self.request.config.option.snapshot_update
# 
#     @property
#     def test_name(self):
#         cls_name = getattr(self.request.node.cls, "__name__", "")
#         flattened_node_name = re.sub(
#             r"\s+", " ", self.request.node.name.replace(r"\n", " ")
#         )
#         return "{}{} {}".format(
#             "{}.".format(cls_name) if cls_name else "",
#             flattened_node_name,
#             self.curr_snapshot,
#         )


# Path: tests/test_pytest.py
import pytest
from snapshottest.pytest import PyTestSnapshotTest




@pytest.fixture
def options():
    return {}


@pytest.fixture
def _apply_options(request, monkeypatch, options):
    for k, v in options.items():
        monkeypatch.setattr(request.config, k, v, raising=False)


@pytest.fixture
def pytest_snapshot_test(request, _apply_options):

    return PyTestSnapshotTest(request)