summaryrefslogtreecommitdiff
path: root/tests/test_version_traversal.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-05-20 14:17:53 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-05-20 14:17:53 -0400
commit8d5a9a1b0d32fff5726010afffa48cc0fb738238 (patch)
treed317665f5531aad7fb507e45273eed68da62ba28 /tests/test_version_traversal.py
parent361076e847c7c60dd00438f1a612aba799e90b1d (diff)
downloadalembic-8d5a9a1b0d32fff5726010afffa48cc0fb738238.tar.gz
ensure heads remain unique in topological
Fixed regression where a revision file that contained its own down revision as a dependency would cause an endless loop in the traversal logic. Change-Id: Ie8bd3b4d9f81e4bda131ffdbabe7a90c4a715054 Fixes: #843
Diffstat (limited to 'tests/test_version_traversal.py')
-rw-r--r--tests/test_version_traversal.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_version_traversal.py b/tests/test_version_traversal.py
index 3895607..d3709d2 100644
--- a/tests/test_version_traversal.py
+++ b/tests/test_version_traversal.py
@@ -1125,6 +1125,29 @@ class DependsOnBranchTestThree(MigrationTest):
)
+class DependsOnOwnDownrevTest(MigrationTest):
+ @classmethod
+ def setup_class(cls):
+ """
+ test #843
+ """
+ cls.env = env = staging_env()
+ cls.a1 = env.generate_revision("a1", "->a1", head="base")
+ cls.a2 = env.generate_revision("a2", "->a2", depends_on="a1")
+
+ @classmethod
+ def teardown_class(cls):
+ clear_staging_env()
+
+ def test_traverse(self):
+ self._assert_upgrade(
+ self.a2.revision,
+ None,
+ [self.up_(self.a1), self.up_(self.a2)],
+ set(["a2"]),
+ )
+
+
class DependsOnBranchTestFour(MigrationTest):
@classmethod
def setup_class(cls):