Mike Bayer avatar Mike Bayer committed 3f9eb7e

- reinstate insert returning back into test_insert.py; defaultdialect
needs to be explicit here since tablestest sticks testing.db onto metadata.bind

Comments (0)

Files changed (2)

test/sql/test_compiler.py

 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

test/sql/test_insert.py

         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'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.