summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-10-09 17:20:30 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-10-09 17:20:30 -0400
commit81d1e0455a406560be468d1aacc37aa63bb4d717 (patch)
tree8e5289a8ecf3d32de4bc13902831ce8a01c245c9 /test/sql/test_selectable.py
parentc55d10940b1953fce2129e7bcfe1728bea33cd1d (diff)
downloadsqlalchemy-81d1e0455a406560be468d1aacc37aa63bb4d717.tar.gz
- Fixed bug where a fair number of SQL elements within
the sql package would fail to ``__repr__()`` successfully, due to a missing ``description`` attribute that would then invoke a recursion overflow when an internal AttributeError would then re-invoke ``__repr__()``. fixes #3195
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index a3b2b0e93..99d0cbe76 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -5,6 +5,7 @@ from sqlalchemy.testing import eq_, assert_raises, \
from sqlalchemy import *
from sqlalchemy.testing import fixtures, AssertsCompiledSQL, \
AssertsExecutionResults
+from sqlalchemy.sql import elements
from sqlalchemy import testing
from sqlalchemy.sql import util as sql_util, visitors, expression
from sqlalchemy import exc
@@ -1934,6 +1935,29 @@ class AnnotationsTest(fixtures.TestBase):
assert (c2 == 5).left._annotations == {"foo": "bar", "bat": "hoho"}
+class ReprTest(fixtures.TestBase):
+ def test_ensure_repr_elements(self):
+ for obj in [
+ elements.Cast(1, 2),
+ elements.TypeClause(String()),
+ elements.ColumnClause('x'),
+ elements.BindParameter('q'),
+ elements.Null(),
+ elements.True_(),
+ elements.False_(),
+ elements.ClauseList(),
+ elements.BooleanClauseList.and_(),
+ elements.Tuple(),
+ elements.Case([]),
+ elements.Extract('foo', column('x')),
+ elements.UnaryExpression(column('x')),
+ elements.Grouping(column('x')),
+ elements.Over(func.foo()),
+ elements.Label('q', column('x')),
+ ]:
+ repr(obj)
+
+
class WithLabelsTest(fixtures.TestBase):
def _assert_labels_warning(self, s):