Skip to content

test: autouse fixture for brand_manifest warning dedup + cross-adapter dedup coverage #689

@bokelley

Description

@bokelley

Background

Follow-up from #688 review (PR for #687). Two non-blocking nits flagged by code-reviewer:

  1. Autouse fixture for _brand_manifest_path_warned reset. Every existing test for the brand_manifest non-standard-path warning does the same monkeypatch.setattr(_url_mod, "_brand_manifest_path_warned", set()) boilerplate. A future test that forgets the reset would silently inherit state from prior tests and flake intermittently. Centralizing as an autouse fixture eliminates the boilerplate and removes the failure mode.

  2. Cross-adapter dedup test. After Extend brand_manifest non-standard-path warning to inline-object branch #687 centralized the dedup state in _url.py, the dedup set is shared across get_products and create_media_buy. That's the intended behaviour (same offending URL through any adapter only warns once per process), but no test documents the semantic. If someone refactors back to per-module state, nothing catches it.

Scope

  • tests/conftest.py: add scoped autouse fixture that resets adcp.compat.legacy.v2_5._url._brand_manifest_path_warned between tests.
  • Remove the now-redundant monkeypatch.setattr(_url_mod, "_brand_manifest_path_warned", set()) calls from the existing 10 tests in tests/test_legacy_adapter_v2_5_get_products.py and tests/test_legacy_adapter_v2_5_media_buy.py.
  • Add one cross-adapter test asserting that the same CDN URL through get_products.adapt_request and create_media_buy.adapt_request warns exactly once.

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions