Skip to main content

Testing toolkit for Alembic migrations — run your migrations through the gauntlet

Project description

alembic-gauntlet

Testing toolkit for Alembic migrations — run your migrations through the gauntlet

PyPI Python License CI codecov Docs

Installation

pip install alembic-gauntlet

Requirements: Python 3.11+

Quick start

import pytest
from alembic_gauntlet import MigrationTestBase
from sqlalchemy import MetaData
from myapp.db import Base


@pytest.mark.integration
class TestMyMigrations(MigrationTestBase):
    """All five tests inherited automatically."""

    @pytest.fixture
    def orm_metadata(self) -> MetaData:
        return Base.metadata

    @pytest.fixture(scope="session")
    def migration_db_url(self) -> str:
        return "postgresql+asyncpg://user:pass@localhost/testdb"

That's it! You now have:

  • test_stairway_upgrade_downgrade — each migration forward and back
  • test_migrations_up_to_date — schema matches ORM models
  • test_single_head_revision — no unmerged branches
  • test_downgrade_all_the_way — full downgrade to base
  • test_naming_conventions — indexes and FKs follow conventions

Documentation

Full documentation at bedrock-python.github.io/alembic-gauntlet.

License

Apache 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alembic_gauntlet-0.2.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alembic_gauntlet-0.2.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file alembic_gauntlet-0.2.0.tar.gz.

File metadata

  • Download URL: alembic_gauntlet-0.2.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alembic_gauntlet-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8c07f2bce011e9ddaea3c52770102ce3431bd9cb3f755359d7e920a6c050404b
MD5 f59888acebd780622e216c39fe7820ef
BLAKE2b-256 156710803f1698ede82ab9c1fa962d24cd13acebddb818292d16a007435eb238

See more details on using hashes here.

File details

Details for the file alembic_gauntlet-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: alembic_gauntlet-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alembic_gauntlet-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b039aa68043460c07aa1dd26f8cb065c20f3533d6dbb8d9244d2d8e5fd8a10
MD5 61969a43de0b6e4ea1fba020b9ce1d97
BLAKE2b-256 486eecca1e34b0b99fa978bafac62ab9c15b09ccd77b6dfa0c639703ff91c49a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page