fixup(cadastre): tile_size unified param + register slow marker (#168 PR3)

Blocker #1: rename tile_width/tile_height → tile_size in generate_grid_click_points.
Callers in bulk_harvest.py and test_cadastre_bulk.py used tile_size; def had
tile_width+tile_height → TypeError at runtime.

Blocker #2 (10 failures in test_admin_cadastre.py) was side-effect of #1:
TypeError at import chain (app.main → admin_cadastre → bulk_harvest)
broke FastAPI app load → dependency_overrides AttributeError. Now resolved.

Also register `slow` pytest marker in pyproject.toml to suppress
PytestUnknownMarkWarning.
This commit is contained in:
lekss361 2026-05-15 13:17:48 +03:00
parent 60f075cf9f
commit 32eeda5db1
2 changed files with 7 additions and 6 deletions

View file

@ -57,8 +57,7 @@ def quarter_bbox_3857(db: Session, quarter: str) -> tuple[float, float, float, f
def generate_grid_click_points(
bbox: tuple[float, float, float, float],
grid_size: int = 15,
tile_width: int = 512,
tile_height: int = 512,
tile_size: int = 512,
) -> list[tuple[tuple[float, float, float, float], tuple[int, int]]]:
"""Генерировать grid_size × grid_size ячеек для bbox квартала.
@ -69,8 +68,7 @@ def generate_grid_click_points(
Args:
bbox: (xmin, ymin, xmax, ymax) в EPSG:3857.
grid_size: количество ячеек по каждой оси (15 225 запросов).
tile_width: ширина виртуального WMS тайла в пикселях.
tile_height: высота виртуального WMS тайла в пикселях.
tile_size: размер виртуального WMS тайла в пикселях (квадратный).
Returns:
Список (sub_bbox, click_xy) sub_bbox в EPSG:3857, click_xy в пикселях.
@ -88,8 +86,8 @@ def generate_grid_click_points(
cell_xmax = cell_xmin + x_step
cell_ymax = cell_ymin + y_step
# Клик в центр ячейки
click_x = tile_width // 2
click_y = tile_height // 2
click_x = tile_size // 2
click_y = tile_size // 2
result.append(
(
(cell_xmin, cell_ymin, cell_xmax, cell_ymax),

View file

@ -79,3 +79,6 @@ strict = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
markers = [
"slow: marks tests as slow (need real network, deselect with -m 'not slow')",
]