-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: (Huge speed optimization) Avoid the use of the high-level alembi…
…c command interface in most cases. In particular, the `alembic.command.<x>` (where <x> is something like upgrade, downgrade, or head(s)). These commands are (seemingly) intended to be used as one-off commands because they internally create `ScriptDirectory` objects. Given that we execute numerous individual commands per test, that creation step adds up leads to (with any appreciable history length) test runtime. An `alembic upgrade head` which takes 20s can take up to 5m before this change. This PR switches to internally producing a `ScriptDirectory` once, and reimplementing some of the internals of the `alembic.command` interface becuase there isn't a public way of providing a script to those functions.
- Loading branch information
Showing
5 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pytest-alembic" | ||
version = "0.7.0" | ||
version = "0.8.0" | ||
description = "A pytest plugin for verifying alembic migrations." | ||
authors = [ | ||
"Dan Cardin <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters