diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-27 19:53:57 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-04-27 19:53:57 -0400 |
| commit | 4b614b9b35cd2baddb7ca67c04bee5d70ec6a172 (patch) | |
| tree | 7483cd269f5823f903f96709eb864fff9b6d9383 /test/dialect/test_mssql.py | |
| parent | 9716a5c45e6185c5871555722d8495880f0e8c7a (diff) | |
| download | sqlalchemy-4b614b9b35cd2baddb7ca67c04bee5d70ec6a172.tar.gz | |
- the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
Diffstat (limited to 'test/dialect/test_mssql.py')
| -rw-r--r-- | test/dialect/test_mssql.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/dialect/test_mssql.py b/test/dialect/test_mssql.py index f1cd3fe85..cca06f1cc 100644 --- a/test/dialect/test_mssql.py +++ b/test/dialect/test_mssql.py @@ -403,7 +403,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): self.assert_compile( s, "SELECT TOP 10 t.x, t.y FROM t WHERE t.x = :x_1 ORDER BY t.y", - checkparams={u'x_1': 5} + checkparams={'x_1': 5} ) def test_limit_zero_using_top(self): @@ -414,7 +414,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): self.assert_compile( s, "SELECT TOP 0 t.x, t.y FROM t WHERE t.x = :x_1 ORDER BY t.y", - checkparams={u'x_1': 5} + checkparams={'x_1': 5} ) def test_offset_using_window(self): @@ -424,14 +424,14 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): # test that the select is not altered with subsequent compile # calls - for i in xrange(2): + for i in range(2): self.assert_compile( s, "SELECT anon_1.x, anon_1.y FROM (SELECT t.x AS x, t.y " "AS y, ROW_NUMBER() OVER (ORDER BY t.y) AS " "mssql_rn FROM t WHERE t.x = :x_1) AS " "anon_1 WHERE mssql_rn > :mssql_rn_1", - checkparams={u'mssql_rn_1': 20, u'x_1': 5} + checkparams={'mssql_rn_1': 20, 'x_1': 5} ) def test_limit_offset_using_window(self): @@ -447,7 +447,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "FROM t " "WHERE t.x = :x_1) AS anon_1 " "WHERE mssql_rn > :mssql_rn_1 AND mssql_rn <= :mssql_rn_2", - checkparams={u'mssql_rn_1': 20, u'mssql_rn_2': 30, u'x_1': 5} + checkparams={'mssql_rn_1': 20, 'mssql_rn_2': 30, 'x_1': 5} ) def test_limit_offset_with_correlated_order_by(self): @@ -468,7 +468,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "FROM t1 " "WHERE t1.x = :x_1) AS anon_1 " "WHERE mssql_rn > :mssql_rn_1 AND mssql_rn <= :mssql_rn_2", - checkparams={u'mssql_rn_1': 20, u'mssql_rn_2': 30, u'x_1': 5} + checkparams={'mssql_rn_1': 20, 'mssql_rn_2': 30, 'x_1': 5} ) def test_limit_zero_offset_using_window(self): @@ -482,7 +482,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): s, "SELECT TOP 0 t.x, t.y FROM t " "WHERE t.x = :x_1 ORDER BY t.y", - checkparams={u'x_1': 5} + checkparams={'x_1': 5} ) def test_sequence_start_0(self): @@ -851,11 +851,11 @@ class QueryUnicodeTest(fixtures.TestBase): # encode in UTF-8 (sting object) because this is the default # dialect encoding - con.execute(u"insert into unitest_table values ('bien u\ + con.execute("insert into unitest_table values ('bien u\ umang\xc3\xa9')".encode('UTF-8')) try: r = t1.select().execute().first() - assert isinstance(r[1], unicode), \ + assert isinstance(r[1], str), \ '%s is %s instead of unicode, working on %s' % (r[1], type(r[1]), meta.bind) finally: @@ -1707,7 +1707,7 @@ class TypeRoundTripTest(fixtures.TestBase, AssertsExecutionResults, ComparesTabl )] for value in test_items: float_table.insert().execute(floatcol=value) - except Exception, e: + except Exception as e: raise e @@ -1953,8 +1953,8 @@ class MonkeyPatchedBinaryTest(fixtures.TestBase): def test_unicode(self): module = __import__('pymssql') - result = module.Binary(u'foo') - eq_(result, u'foo') + result = module.Binary('foo') + eq_(result, 'foo') def test_bytes(self): module = __import__('pymssql') @@ -2073,7 +2073,7 @@ class InfoCoerceUnicodeTest(fixtures.TestBase): dialect = mssql.dialect() value = CoerceUnicode().bind_processor(dialect)('a string') - assert isinstance(value, unicode) + assert isinstance(value, str) class ReflectHugeViewTest(fixtures.TestBase): __only_on__ = 'mssql' @@ -2085,13 +2085,13 @@ class ReflectHugeViewTest(fixtures.TestBase): t = Table('base_table', self.metadata, *[ Column("long_named_column_number_%d" % i, Integer) - for i in xrange(self.col_num) + for i in range(self.col_num) ] ) self.view_str = view_str = \ "CREATE VIEW huge_named_view AS SELECT %s FROM base_table" % ( ",".join("long_named_column_number_%d" % i - for i in xrange(self.col_num)) + for i in range(self.col_num)) ) assert len(view_str) > 4000 |
