diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dialect/test_postgresql.py | 3 | ||||
-rw-r--r-- | test/sql/test_operators.py | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index 40d8d0c79..ab3f54a66 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -2941,7 +2941,8 @@ class HStoreTest(fixtures.TestBase): def test_cols_keys(self): self._test_cols( - self.hashcol.keys(), + # hide from 2to3 + getattr(self.hashcol, 'keys')(), "akeys(test_table.hash) AS akeys_1", True ) diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index eb2885658..9da9d94c3 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -325,6 +325,18 @@ class ExtensionOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL): "x -> :x_1" ) + def test_no_endless_list_call(self): + class MyType(UserDefinedType): + class comparator_factory(UserDefinedType.Comparator): + def __getitem__(self, index): + return self.op("->")(index) + + assert_raises_message( + NotImplementedError, + "Class <class 'sqlalchemy.schema.Column'> is not iterable", + list, Column('x', MyType()) + ) + def test_lshift(self): class MyType(UserDefinedType): class comparator_factory(UserDefinedType.Comparator): |