summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-27 19:53:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-27 19:53:57 -0400
commit4b614b9b35cd2baddb7ca67c04bee5d70ec6a172 (patch)
tree7483cd269f5823f903f96709eb864fff9b6d9383 /test/sql/test_selectable.py
parent9716a5c45e6185c5871555722d8495880f0e8c7a (diff)
downloadsqlalchemy-4b614b9b35cd2baddb7ca67c04bee5d70ec6a172.tar.gz
- the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index e881298a7..e697a7e08 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -174,11 +174,11 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
def test_clone_append_column(self):
sel = select([literal_column('1').label('a')])
- eq_(sel.c.keys(), ['a'])
+ eq_(list(sel.c.keys()), ['a'])
cloned = visitors.ReplacingCloningVisitor().traverse(sel)
cloned.append_column(literal_column('2').label('b'))
cloned.append_column(func.foo())
- eq_(cloned.c.keys(), ['a', 'b', 'foo()'])
+ eq_(list(cloned.c.keys()), ['a', 'b', 'foo()'])
def test_append_column_after_replace_selectable(self):
basesel = select([literal_column('1').label('a')])
@@ -362,10 +362,10 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
def test_join(self):
a = join(table1, table2)
- print str(a.select(use_labels=True))
+ print(str(a.select(use_labels=True)))
b = table2.alias('b')
j = join(a, b)
- print str(j)
+ print(str(j))
criterion = a.c.table1_col1 == b.c.col2
self.assert_(criterion.compare(j.onclause))
@@ -949,7 +949,7 @@ class PrimaryKeyTest(fixtures.TestBase, AssertsExecutionResults):
primary_key=True), Column('x', Integer))
d = Table('d', meta, Column('id', Integer, ForeignKey('c.id'),
primary_key=True), Column('x', Integer))
- print list(a.join(b, a.c.x == b.c.id).primary_key)
+ print(list(a.join(b, a.c.x == b.c.id).primary_key))
assert list(a.join(b, a.c.x == b.c.id).primary_key) == [a.c.id]
assert list(b.join(c, b.c.x == c.c.id).primary_key) == [b.c.id]
assert list(a.join(b).join(c, c.c.id == b.c.x).primary_key) \
@@ -1618,7 +1618,7 @@ class WithLabelsTest(fixtures.TestBase):
def test_names_overlap_label(self):
sel = self._names_overlap().apply_labels()
eq_(
- sel.c.keys(),
+ list(sel.c.keys()),
['t1_x', 't2_x']
)
self._assert_result_keys(sel, ['t1_x', 't2_x'])
@@ -1632,7 +1632,7 @@ class WithLabelsTest(fixtures.TestBase):
def test_names_overlap_keys_dont_nolabel(self):
sel = self._names_overlap_keys_dont()
eq_(
- sel.c.keys(),
+ list(sel.c.keys()),
['a', 'b']
)
self._assert_result_keys(sel, ['x'])
@@ -1640,7 +1640,7 @@ class WithLabelsTest(fixtures.TestBase):
def test_names_overlap_keys_dont_label(self):
sel = self._names_overlap_keys_dont().apply_labels()
eq_(
- sel.c.keys(),
+ list(sel.c.keys()),
['t1_a', 't2_b']
)
self._assert_result_keys(sel, ['t1_x', 't2_x'])
@@ -1654,7 +1654,7 @@ class WithLabelsTest(fixtures.TestBase):
def test_labels_overlap_nolabel(self):
sel = self._labels_overlap()
eq_(
- sel.c.keys(),
+ list(sel.c.keys()),
['x_id', 'id']
)
self._assert_result_keys(sel, ['x_id', 'id'])
@@ -1663,7 +1663,7 @@ class WithLabelsTest(fixtures.TestBase):
sel = self._labels_overlap().apply_labels()
t2 = sel.froms[1]
eq_(
- sel.c.keys(),
+ list(sel.c.keys()),
['t_x_id', t2.c.id.anon_label]
)
self._assert_result_keys(sel, ['t_x_id', 'id_1'])
@@ -1677,12 +1677,12 @@ class WithLabelsTest(fixtures.TestBase):
def test_labels_overlap_keylabels_dont_nolabel(self):
sel = self._labels_overlap_keylabels_dont()
- eq_(sel.c.keys(), ['a', 'b'])
+ eq_(list(sel.c.keys()), ['a', 'b'])
self._assert_result_keys(sel, ['x_id', 'id'])
def test_labels_overlap_keylabels_dont_label(self):
sel = self._labels_overlap_keylabels_dont().apply_labels()
- eq_(sel.c.keys(), ['t_a', 't_x_b'])
+ eq_(list(sel.c.keys()), ['t_a', 't_x_b'])
self._assert_result_keys(sel, ['t_x_id', 'id_1'])
def _keylabels_overlap_labels_dont(self):
@@ -1693,13 +1693,13 @@ class WithLabelsTest(fixtures.TestBase):
def test_keylabels_overlap_labels_dont_nolabel(self):
sel = self._keylabels_overlap_labels_dont()
- eq_(sel.c.keys(), ['x_id', 'id'])
+ eq_(list(sel.c.keys()), ['x_id', 'id'])
self._assert_result_keys(sel, ['a', 'b'])
def test_keylabels_overlap_labels_dont_label(self):
sel = self._keylabels_overlap_labels_dont().apply_labels()
t2 = sel.froms[1]
- eq_(sel.c.keys(), ['t_x_id', t2.c.id.anon_label])
+ eq_(list(sel.c.keys()), ['t_x_id', t2.c.id.anon_label])
self._assert_result_keys(sel, ['t_a', 't_x_b'])
self._assert_subq_result_keys(sel, ['t_a', 't_x_b'])
@@ -1711,14 +1711,14 @@ class WithLabelsTest(fixtures.TestBase):
def test_keylabels_overlap_labels_overlap_nolabel(self):
sel = self._keylabels_overlap_labels_overlap()
- eq_(sel.c.keys(), ['x_a', 'a'])
+ eq_(list(sel.c.keys()), ['x_a', 'a'])
self._assert_result_keys(sel, ['x_id', 'id'])
self._assert_subq_result_keys(sel, ['x_id', 'id'])
def test_keylabels_overlap_labels_overlap_label(self):
sel = self._keylabels_overlap_labels_overlap().apply_labels()
t2 = sel.froms[1]
- eq_(sel.c.keys(), ['t_x_a', t2.c.a.anon_label])
+ eq_(list(sel.c.keys()), ['t_x_a', t2.c.a.anon_label])
self._assert_result_keys(sel, ['t_x_id', 'id_1'])
self._assert_subq_result_keys(sel, ['t_x_id', 'id_1'])
@@ -1736,7 +1736,7 @@ class WithLabelsTest(fixtures.TestBase):
def test_keys_overlap_names_dont_label(self):
sel = self._keys_overlap_names_dont().apply_labels()
eq_(
- sel.c.keys(),
+ list(sel.c.keys()),
['t1_x', 't2_x']
)
self._assert_result_keys(sel, ['t1_a', 't2_b'])