diff --git a/tests/test_operaciones.py b/tests/test_operaciones.py index 3e46c46..4d993b0 100644 --- a/tests/test_operaciones.py +++ b/tests/test_operaciones.py @@ -16,6 +16,7 @@ import logging from collections.abc import Iterator from datetime import date from decimal import Decimal +from functools import lru_cache from pathlib import Path import pytest @@ -96,8 +97,15 @@ def bytes_fixture() -> bytes: return INCREMENTAL.read_bytes() +@lru_cache(maxsize=1) def bytes_sin_fila_invalida() -> bytes: - """El fixture sin su fila inválida: la carga válida.""" + """El fixture sin su fila inválida: la carga válida. + + Se genera una sola vez: openpyxl graba la hora al guardar (reescribe + `properties.modified` y las fechas de las entradas del zip), así que dos llamadas en + segundos distintos darían bytes y SHA-256 distintos, y la detección de "ya se cargó" + fallaría de forma intermitente. + """ wb = load_workbook(INCREMENTAL) ws = wb["Transacciones"] assert ws.cell(FILA_INVALIDA, 20).value == generador.METODO_INVALIDO