From d993bdeac8674db88efb3c400b4a505c8f97af9e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 3 Jun 2013 16:32:12 -0400 Subject: - remove the ``__iter__()`` with notimplemented since it interferes with legitimate iterable detection, [ticket:2726] --- test/sql/test_operators.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index d1db733e0..b3919d0da 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -15,7 +15,7 @@ from sqlalchemy.dialects import mysql, firebird, postgresql, oracle, \ sqlite, mssql from sqlalchemy import util import datetime - +import collections from sqlalchemy import text, literal_column class LoopOperate(operators.ColumnOperators): @@ -352,17 +352,16 @@ class ExtensionOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL): "x -> :x_1" ) - def test_no_endless_list_call(self): + @testing.requires.python26 + def test_op_not_an_iterator(self): + # see [ticket:2726] class MyType(UserDefinedType): class comparator_factory(UserDefinedType.Comparator): def __getitem__(self, index): return self.op("->")(index) - assert_raises_message( - NotImplementedError, - "Class is not iterable", - list, Column('x', MyType()) - ) + col = Column('x', MyType()) + assert not isinstance(col, collections.Iterable) def test_lshift(self): class MyType(UserDefinedType): -- cgit v1.2.1