"""Pytest fixtures for the purchase-order email-processor suite. Path/env setup and the reusable helpers live in ``_po_parser_support`` (a uniquely named module) so the test files never do ``from conftest import``, which would be ambiguous against the repo's top-level ``tests/conftest.py``. """ import pytest from _po_parser_support import FakeDynamoResource, po_persistence @pytest.fixture def fake_dynamo(monkeypatch): # Phase 5: the dynamodb accessor cache lives on persistence.py now (the # module that owns every DynamoDB write); patch it there. The attribute name # is unchanged ("dynamodb") -- only the module moved. FakeDynamoResource # needs no .meta: its happy path never raises, so _merge_update's # `except _get_dynamodb().meta.client.exceptions...` clause is never # evaluated (moto exercises that path in tests/test_po_merge.py). fake = FakeDynamoResource() monkeypatch.setattr(po_persistence, "dynamodb", fake) return fake