git-subtree-dir: fiscal git-subtree-mainline:d95165fc8fgit-subtree-split:102ba84500
16 lines
610 B
Python
16 lines
610 B
Python
import importlib.util
|
|
from pathlib import Path
|
|
|
|
|
|
def test_alembic_revision_ids_fit_version_num_column():
|
|
versions = Path(__file__).parents[1] / "alembic" / "versions"
|
|
too_long = []
|
|
for path in versions.glob("*.py"):
|
|
spec = importlib.util.spec_from_file_location(f"migration_{path.stem}", path)
|
|
module = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(module)
|
|
revision = getattr(module, "revision", None)
|
|
if revision is not None and len(revision) > 32:
|
|
too_long.append((path.name, revision, len(revision)))
|
|
assert too_long == []
|