backend changes on test files of catalog
This commit is contained in:
@@ -30,6 +30,19 @@ def _sheet(headers, rows) -> bytes:
|
||||
return buf.getvalue()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _isolate_sku_counter(tmp_path, monkeypatch):
|
||||
"""Keep the SKU sequence counter out of the repo.
|
||||
|
||||
`sku_service` persists its per-brand counter to DATA_DIR/sku_sequences so
|
||||
reruns keep issuing fresh numbers. Left alone, running the suite mutates a
|
||||
real directory in the working tree; pointing it at tmp_path keeps each test
|
||||
session self-contained and makes SKU numbering deterministic per test.
|
||||
"""
|
||||
from app.services import sku_service
|
||||
monkeypatch.setattr(sku_service, "_data_dir", tmp_path / "sku_sequences")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def store(monkeypatch):
|
||||
"""A fake brand table. Returns the dict of image_id -> stored row."""
|
||||
|
||||
Reference in New Issue
Block a user