From 39837686b068a6e7016169f31a96a058546e4bdd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 19 Jan 2016 16:47:16 -0500 Subject: - calling str() on a core sql construct has been made more "friendly", when the construct contains non-standard sql elements such as returning, array index operations, or dialect-specific or custom datatypes. a string is now returned in these cases rendering an approximation of the construct (typically the postgresql-style version of it) rather than raising an error. fixes #3631 - add within_group to top-level imports - add eq_ignore_whitespace to sqlalchemy.testing imports --- test/sql/test_compiler.py | 73 ++++++++++++++++++++++++++++++++++++++++++--- test/sql/test_metadata.py | 3 +- test/sql/test_selectable.py | 12 +++++--- 3 files changed, 79 insertions(+), 9 deletions(-) (limited to 'test/sql') diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index 5d082175a..85a9f77bc 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -10,7 +10,8 @@ styling and coherent test organization. """ -from sqlalchemy.testing import eq_, is_, assert_raises, assert_raises_message +from sqlalchemy.testing import eq_, is_, assert_raises, \ + assert_raises_message, eq_ignore_whitespace from sqlalchemy import testing from sqlalchemy.testing import fixtures, AssertsCompiledSQL from sqlalchemy import Integer, String, MetaData, Table, Column, select, \ @@ -2562,7 +2563,7 @@ class UnsupportedTest(fixtures.TestBase): assert_raises_message( exc.UnsupportedCompilationError, - r"Compiler ", SomeElement().compile ) @@ -2578,7 +2579,7 @@ class UnsupportedTest(fixtures.TestBase): assert_raises_message( exc.UnsupportedCompilationError, - r"Compiler ", SomeElement().compile ) @@ -2591,12 +2592,76 @@ class UnsupportedTest(fixtures.TestBase): binary = BinaryExpression(column("foo"), column("bar"), myop) assert_raises_message( exc.UnsupportedCompilationError, - r"Compiler