test(tradein): quality-gate anti-regression тесты на 5 P0-фиксов (#781) #1098

Merged
bot-reviewer merged 1 commit from feat/781-quality-gate-tests into main 2026-06-06 19:27:24 +00:00

1 commit

Author SHA1 Message Date
159a02a800 test(tradein): quality-gate tests for 5 P0 audit fixes (Refs #781)
All checks were successful
CI / changes (push) Successful in 7s
CI / backend-tests (push) Has been skipped
CI / changes (pull_request) Successful in 5s
CI / backend-tests (pull_request) Has been skipped
Anti-regression guards for PRs #877/#761/#784/#779/#743 (issues #755/#753/#773/#754/#740).
All 5 defects had no dedicated lock test -- any refactor could silently re-introduce them.

New file test_781_quality_gate.py (13 tests):
  #755: anchor n=2 < min_comps=4 does not fire; pure-unit confidence cap (n<5 != high)
  #753: compute_dedup_hash stable across reprice + ?context= query strip; source_id priority
  #773: expected_sold_price_rub > 0 on anchor-only path (radius=[]) when ratio present
  #754: page=1 HTTP-200 block raises AvitoContentBlockedError; page>1 graceful return
  #740: AggregatedEstimate.insufficient_data=True when median=0; survives model_dump()

Updated test_estimator_pure_units.py:
  test_filter_outliers_passthrough_below_5_lots -- added docstring clarifying this tests
  the radius-path _filter_outliers (n<5 bypass Tukey is unchanged by #755); #755 added
  MAD-clip only to _compute_same_building_anchor, not to the radius-path filter.

325 tests pass under -k anchor|dedup|expected_sold|avito|insufficient|filter_outliers.
ruff clean.
2026-06-06 22:16:15 +03:00