some fixes
Tests / test (push) Successful in 11s
Tests / lint (push) Successful in 11s

This commit is contained in:
2026-10-16 07:51:13 +01:00
parent b9ecbf6e36
commit 68cb1fa1ed
2 changed files with 19 additions and 2 deletions
+8
View File
@@ -87,11 +87,19 @@ def populated_db_b4w(
Only the first-layer ingestion table is filled; no further processing.
``**kwargs`` are forwarded to ``B4wExportFactory.build``; callable values
are resolved per row (e.g. ``ValDt=lambda: faker.date_between(...)``).
``Id1`` is reserved: it is set per row (``1..row_count``) and cannot be
overridden via ``**kwargs``.
The returned session is *not* closed by the fixture; close it in the test.
"""
def populate_db_b4w(
name: str, row_count: int = DEFAULT_B4W_ROWS, **kwargs: Any
) -> Session:
if "Id1" in kwargs:
raise ValueError(
"Id1 is set per row (1..row_count) by populated_db_b4w and "
"cannot be overridden via **kwargs"
)
session = db_session_factory(name)
for i in range(row_count):
row_kwargs = {k: (v() if callable(v) else v) for k, v in kwargs.items()}