"""Fixtures: real Treasury documents, from the shapes that differ. The auction query is one JSON document a hundred and twenty fields wide, and the fields do not all start at the same time: bidder categories, the competitive breakdown and the result artifact that states the release minute all begin in 2008. The fixtures here are a handful of rows from that query -- one auction from before 2008 and several from after it -- and the small XML artifacts that go with them. The rate feeds are fixed for a single year each. That is enough, because the thing that changes between years is which columns exist, and the fixtures include a year with a 20-year point and one without. """ from __future__ import annotations import gzip import json from pathlib import Path import pytest FIXTURES = Path(__file__).parent / "fixtures" def load(relative: str) -> str: path = FIXTURES / relative if path.suffix == ".gz": return gzip.decompress(path.read_bytes()).decode("utf-8", errors="replace") return path.read_text(encoding="utf-8") @pytest.fixture def load_fixture(): """The loader as a fixture: `tests` is not importable as a package.""" return load @pytest.fixture def auction_rows(): return json.loads(load("auctions/query_sample.json.gz"))