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.1.0.tar.gz (15.6 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.1.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alembic_gauntlet-0.1.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.1.0.tar.gz
Algorithm Hash digest
SHA256 e6f04cdc076d348a9caf688792a8d7b0625b2a9c292e7f91aa219d72aee6a92d
MD5 6f69bf888fe5b6d537534ea8b034f535
BLAKE2b-256 d860df25789812d977a46db779a13dadc03f06181731004fb8cc6e6b99d6e244

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alembic_gauntlet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c750773015c2a4af95fb049b8edff89d765a9b37a826a35924c0520b0613757
MD5 b59ec9bb1e35b9da13d7203e9886df93
BLAKE2b-256 ab45dd21f3a98bcea37355b0d0aa36c3558f5e3b6a554f2cc302024181df8444

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