diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-07 17:51:12 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-07 17:51:12 -0400 |
| commit | 0d9ec9fe840eb71935c2a55c3063620a028e59aa (patch) | |
| tree | b1243b5b7bba44066d3f5bb451f0d3ab2c97cd57 /test/orm/test_query.py | |
| parent | 1188edccf6b796fdc2d8bd24985a71fb6060eae7 (diff) | |
| download | sqlalchemy-0d9ec9fe840eb71935c2a55c3063620a028e59aa.tar.gz | |
remove all remaining start/end py2k/py3k blocks
Diffstat (limited to 'test/orm/test_query.py')
| -rw-r--r-- | test/orm/test_query.py | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/test/orm/test_query.py b/test/orm/test_query.py index 2e0355e63..c38fb351e 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -1,4 +1,4 @@ -import operator +from sqlalchemy.sql import operators from sqlalchemy import MetaData, null, exists, text, union, literal, \ literal_column, func, between, Unicode, desc, and_, bindparam, \ select, distinct, or_, collate @@ -407,12 +407,7 @@ class GetTest(QueryTest): Column('data', Unicode(40))) try: metadata.create_all() -# start Py3K - ustring = b'petit voix m\xe2\x80\x99a'.decode('utf-8') -# end Py3K -# start Py2K -# ustring = 'petit voix m\xe2\x80\x99a'.decode('utf-8') -# end Py2K + ustring = util.b('petit voix m\xe2\x80\x99a').decode('utf-8') table.insert().execute(id=ustring, data=ustring) class LocalFoo(self.classes.Base): @@ -634,13 +629,10 @@ class OperatorTest(QueryTest, AssertsCompiledSQL): User = self.classes.User create_session().query(User) - for (py_op, sql_op) in ((operator.add, '+'), (operator.mul, '*'), - (operator.sub, '-'), - # Py3k - #(operator.truediv, '/'), -# start Py2K -# (operator.div, '/'), -# end Py2K + for (py_op, sql_op) in ((operators.add, '+'), (operators.mul, '*'), + (operators.sub, '-'), + (operators.truediv, '/'), + (operators.div, '/'), ): for (lhs, rhs, res) in ( (5, User.id, ':id_1 %s users.id'), @@ -660,12 +652,12 @@ class OperatorTest(QueryTest, AssertsCompiledSQL): create_session().query(User) ualias = aliased(User) - for (py_op, fwd_op, rev_op) in ((operator.lt, '<', '>'), - (operator.gt, '>', '<'), - (operator.eq, '=', '='), - (operator.ne, '!=', '!='), - (operator.le, '<=', '>='), - (operator.ge, '>=', '<=')): + for (py_op, fwd_op, rev_op) in ((operators.lt, '<', '>'), + (operators.gt, '>', '<'), + (operators.eq, '=', '='), + (operators.ne, '!=', '!='), + (operators.le, '<=', '>='), + (operators.ge, '>=', '<=')): for (lhs, rhs, l_sql, r_sql) in ( ('a', User.id, ':id_1', 'users.id'), ('a', literal('b'), ':param_2', ':param_1'), # note swap! |
