Skip to content

Testing: add unit test for SLM tablename collision check (#1878) #2226

@mrveiss

Description

@mrveiss

Problem

PR #2205 added _check_tablename_collisions() to SLM main.py (closing #1878), but no unit test was included. The function detects shared tablenames across the two SQLAlchemy Base MetaData objects — a regression safety net for incidents like #1854.

Discovered During

Code review of PR #2205.

Impact

Severity: low — The function is simple (set intersection + logging), but a unit test would verify:

  1. Collisions are detected and logged as WARNING
  2. No-collision case logs INFO with correct table counts
  3. The function doesn't raise (intentional shared names are expected)

Suggested Approach

Mock SLMBase.metadata.tables and UMBase.metadata.tables with controlled dictionaries, call _check_tablename_collisions(), and assert log output.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions