]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
-Repaired a regression in both the MSSQL and Oracle dialects whereby
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Dec 2014 17:55:08 +0000 (12:55 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Dec 2014 17:57:01 +0000 (12:57 -0500)
the overridden ``_exec()`` method failed to return a value, as is
needed now in the 0.7 series. fixes #253
- add __backend__ to UpdateRevTest which does a great job testing
_exec() pathing for all backends

alembic/ddl/impl.py
alembic/ddl/mssql.py
alembic/ddl/oracle.py
docs/build/changelog.rst
tests/test_version_table.py

index b069e47e9e653444b94e3c54bac7696693aa3d53..cb59cffa7378e1b0aa29d0d1f0f0aa76d67d4e3d 100644 (file)
@@ -83,7 +83,6 @@ class DefaultImpl(with_metaclass(ImplMeta)):
 
         """
 
-
     @property
     def bind(self):
         return self.connection
index bcc4ebd3a1751bfe80601e3aa9eb42051433f5a9..26c8a2560e3f16a6b8bd7bf9685ef52285422af3 100644 (file)
@@ -20,9 +20,10 @@ class MSSQLImpl(DefaultImpl):
             self.batch_separator)
 
     def _exec(self, construct, *args, **kw):
-        super(MSSQLImpl, self)._exec(construct, *args, **kw)
+        result = super(MSSQLImpl, self)._exec(construct, *args, **kw)
         if self.as_sql and self.batch_separator:
             self.static_output(self.batch_separator)
+        return result
 
     def emit_begin(self):
         self.static_output("BEGIN TRANSACTION" + self.command_terminator)
index cfe708ca59a6c2f01a56a386f4d23b154e37f6fd..e528744ccce1bb21e4c5f59131c89739a0806b99 100644 (file)
@@ -19,9 +19,10 @@ class OracleImpl(DefaultImpl):
             self.batch_separator)
 
     def _exec(self, construct, *args, **kw):
-        super(OracleImpl, self)._exec(construct, *args, **kw)
+        result = super(OracleImpl, self)._exec(construct, *args, **kw)
         if self.as_sql and self.batch_separator:
             self.static_output(self.batch_separator)
+        return result
 
     def emit_begin(self):
         self._exec("SET TRANSACTION READ WRITE")
index 8fe521675d2f16640393d63068478c0058ff8319..145cab69ae735fa34fddd1c77e3364239429b072 100644 (file)
@@ -16,6 +16,14 @@ Changelog
       named after the column and look like the FK indexes.  Pull request
       courtesy Johannes Erdfelt.
 
+    .. change::
+      :tags: bug, mssql, oracle
+      :tickets: 253
+
+      Repaired a regression in both the MSSQL and Oracle dialects whereby
+      the overridden ``_exec()`` method failed to return a value, as is
+      needed now in the 0.7 series.
+
 .. changelog::
     :version: 0.7.1
     :released: December 3, 2014
index 22711807e572b854b7d9206be53ef66b75e7c3ea..704bb317ee607783d509de926e08adf17600ccbf 100644 (file)
@@ -128,6 +128,7 @@ class TestMigrationContext(TestBase):
 
 
 class UpdateRevTest(TestBase):
+    __backend__ = True
 
     @classmethod
     def setup_class(cls):
@@ -146,7 +147,7 @@ class UpdateRevTest(TestBase):
         self.connection.close()
 
     def _assert_heads(self, heads):
-        eq_(self.context.get_current_heads(), heads)
+        eq_(set(self.context.get_current_heads()), set(heads))
         eq_(self.updater.heads, set(heads))
 
     def test_update_none_to_single(self):