alembic-gauntlet
Testing toolkit for Alembic migrations — run your migrations through the gauntlet
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 backtest_migrations_up_to_date— schema matches ORM modelstest_single_head_revision— no unmerged branchestest_downgrade_all_the_way— full downgrade to basetest_naming_conventions— indexes and FKs follow conventions
Documentation
Full documentation at bedrock-python.github.io/alembic-gauntlet.
License
Apache 2.0 — see LICENSE.
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.1.tar.gz
(18.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alembic_gauntlet-0.2.1.tar.gz.
File metadata
- Download URL: alembic_gauntlet-0.2.1.tar.gz
- Upload date:
- Size: 18.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d2bd6063c84eedcae4e258ae129626b03e6d639ad5dd183129af3d0d099bc38
|
|
| MD5 |
d525eb8f5339c2a510da2dfa97ad18aa
|
|
| BLAKE2b-256 |
0124fc7c75c2d57f30a754fa317f1769f78c9c2f25aa3ef1539e7f9324f7a999
|
File details
Details for the file alembic_gauntlet-0.2.1-py3-none-any.whl.
File metadata
- Download URL: alembic_gauntlet-0.2.1-py3-none-any.whl
- Upload date:
- Size: 26.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cbecfc2851cfda979197ed0502fd582ecb0f53756cd3d514c29288ab1a4d704
|
|
| MD5 |
8485204747c974719a8341dc60f7ab49
|
|
| BLAKE2b-256 |
d2750fdf28bf0c118fce1a8257f90f649f3f2cfdae5a7e07202c5f80c027a8db
|