diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2021-10-30 22:00:25 +0200 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-11-01 15:11:25 -0400 |
| commit | 36e7aebd8d6faac77570403e99f9aa7b2330fa59 (patch) | |
| tree | f45950f61a4b27f128518be52157021ca4f4e8f7 /test/sql | |
| parent | a99ea884403de1e1f762e9b1eb635d7fc6ef8e6f (diff) | |
| download | sqlalchemy-36e7aebd8d6faac77570403e99f9aa7b2330fa59.tar.gz | |
First round of removal of python 2
References: #4600
Change-Id: I61e35bc93fe95610ae75b31c18a3282558cd4ffe
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_compare.py | 2 | ||||
| -rw-r--r-- | test/sql/test_operators.py | 4 | ||||
| -rw-r--r-- | test/sql/test_quote.py | 6 | ||||
| -rw-r--r-- | test/sql/test_resultset.py | 22 |
4 files changed, 3 insertions, 31 deletions
diff --git a/test/sql/test_compare.py b/test/sql/test_compare.py index 2db7a5744..8ec88a760 100644 --- a/test/sql/test_compare.py +++ b/test/sql/test_compare.py @@ -1592,7 +1592,7 @@ class CompareClausesTest(fixtures.TestBase): ) l2 = ClauseList( - table_c.c.x, table_c.c.y, table_d.c.y, operator=operators.div + table_c.c.x, table_c.c.y, table_d.c.y, operator=operators.truediv ) is_false(l1.compare(l2)) diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index c001dc4ef..3bb097714 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -2184,7 +2184,7 @@ class MathOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL): ("add", operator.add, "+"), ("mul", operator.mul, "*"), ("sub", operator.sub, "-"), - ("div", operator.truediv if util.py3k else operator.div, "/"), + ("div", operator.truediv, "/"), ("mod", operator.mod, "%"), id_="iaa", ) @@ -3245,7 +3245,6 @@ class TupleTypingTest(fixtures.TestBase): self._assert_types(expr.right.type.types) # since we want to infer "binary" - @testing.requires.python3 def test_tuple_type_expanding_inference(self): a, b, c = column("a"), column("b"), column("c") @@ -3256,7 +3255,6 @@ class TupleTypingTest(fixtures.TestBase): self._assert_types(expr.right.type.types) - @testing.requires.python3 def test_tuple_type_plain_inference(self): a, b, c = column("a"), column("b"), column("c") diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py index e51bdf5a0..67954d9ce 100644 --- a/test/sql/test_quote.py +++ b/test/sql/test_quote.py @@ -13,7 +13,6 @@ from sqlalchemy import select from sqlalchemy import sql from sqlalchemy import Table from sqlalchemy import testing -from sqlalchemy import util from sqlalchemy.engine import default from sqlalchemy.sql import compiler from sqlalchemy.sql import LABEL_STYLE_TABLENAME_PLUS_COL @@ -251,10 +250,7 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): def test_repr_unicode(self): name = quoted_name(u"姓名", None) - if util.py2k: - eq_(repr(name), "'\u59d3\u540d'") - else: - eq_(repr(name), repr(u"姓名")) + eq_(repr(name), repr(u"姓名")) def test_lower_case_names(self): # Create table with quote defaults diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py index 47f26ddab..86aa15f26 100644 --- a/test/sql/test_resultset.py +++ b/test/sql/test_resultset.py @@ -1139,7 +1139,6 @@ class CursorResultTest(fixtures.TablesTest): eq_(row._mapping[s.c.user_id], 7) eq_(row._mapping[s.c.user_name], "ed") - @testing.requires.python3 def test_ro_mapping_py3k(self, connection): users = self.tables.users @@ -1162,27 +1161,6 @@ class CursorResultTest(fixtures.TablesTest): eq_(odict_row.values(), mapping_row.values()) eq_(odict_row.items(), mapping_row.items()) - @testing.requires.python2 - def test_ro_mapping_py2k(self, connection): - users = self.tables.users - - connection.execute(users.insert(), dict(user_id=1, user_name="foo")) - result = connection.execute(users.select()) - - row = result.first() - dict_row = row._asdict() - - odict_row = collections.OrderedDict( - [("user_id", 1), ("user_name", "foo")] - ) - eq_(dict_row, odict_row) - mapping_row = row._mapping - - eq_(list(mapping_row), list(mapping_row.keys())) - eq_(odict_row.keys(), list(mapping_row.keys())) - eq_(odict_row.values(), list(mapping_row.values())) - eq_(odict_row.items(), list(mapping_row.items())) - @testing.combinations( (lambda result: result), (lambda result: result.first(),), |
