From: Mike Bayer Date: Mon, 1 Apr 2013 19:41:57 +0000 (-0400) Subject: - reinstate insert returning back into test_insert.py; defaultdialect X-Git-Tag: rel_0_8_1~24^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bdd3bb93fd18a4aec54ee2a836875a922dcaab3;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - reinstate insert returning back into test_insert.py; defaultdialect needs to be explicit here since tablestest sticks testing.db onto metadata.bind --- diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index c3638f52fc..9cd893c1ad 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -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 diff --git a/test/sql/test_insert.py b/test/sql/test_insert.py index c74e11e182..cd040538f5 100644 --- a/test/sql/test_insert.py +++ b/test/sql/test_insert.py @@ -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'