]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- reinstate insert returning back into test_insert.py; defaultdialect
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Apr 2013 19:41:57 +0000 (15:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Apr 2013 19:41:57 +0000 (15:41 -0400)
needs to be explicit here since tablestest sticks testing.db onto metadata.bind

test/sql/test_compiler.py
test/sql/test_insert.py

index c3638f52fce3cec7de14426cd0b309d9093b4e0b..9cd893c1adc871c22764f9e2bfe9721b5733506c 100644 (file)
@@ -2460,10 +2460,6 @@ class KwargPropagationTest(fixtures.TestBase):
 class CRUDTest(fixtures.TestBase, AssertsCompiledSQL):
     __dialect__ = 'default'
 
-    def test_insert_returning_not_in_default(self):
-        stmt = table1.insert().returning(table1.c.myid)
-        m = "RETURNING is not supported by this dialect's statement compiler."
-        assert_raises_message(exc.CompileError, m, stmt.compile)
 
     def test_correlated_update(self):
         # test against a straight text subquery
index c74e11e18249c10d0aa577e9f8d23d0fe5c767ff..cd040538f5ca4056416c496f255d0a856dadfc1d 100644 (file)
@@ -109,6 +109,16 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
         self.assert_compile(table.insert(inline=True),
             'INSERT INTO sometable (foo) VALUES (foobar())', params={})
 
+    def test_insert_returning_not_in_default(self):
+        table1 = self.tables.mytable
+
+        stmt = table1.insert().returning(table1.c.myid)
+        assert_raises_message(
+            exc.CompileError,
+            "RETURNING is not supported by this dialect's statement compiler.",
+            stmt.compile,
+            dialect=default.DefaultDialect()
+        )
 
 class EmptyTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
     __dialect__ = 'default'