summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/fixtures.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing/fixtures.py')
-rw-r--r--lib/sqlalchemy/testing/fixtures.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py
index 5c587cb2f..08b2361f2 100644
--- a/lib/sqlalchemy/testing/fixtures.py
+++ b/lib/sqlalchemy/testing/fixtures.py
@@ -125,9 +125,9 @@ class TablesTest(TestBase):
for table in reversed(self.metadata.sorted_tables):
try:
table.delete().execute().close()
- except sa.exc.DBAPIError, ex:
- print >> sys.stderr, "Error emptying table %s: %r" % (
- table, ex)
+ except sa.exc.DBAPIError as ex:
+ print("Error emptying table %s: %r" % (
+ table, ex), file=sys.stderr)
def setup(self):
self._setup_each_tables()
@@ -187,10 +187,10 @@ class TablesTest(TestBase):
def _load_fixtures(cls):
"""Insert rows as represented by the fixtures() method."""
headers, rows = {}, {}
- for table, data in cls.fixtures().iteritems():
+ for table, data in cls.fixtures().items():
if len(data) < 2:
continue
- if isinstance(table, basestring):
+ if isinstance(table, str):
table = cls.tables[table]
headers[table] = data[0]
rows[table] = data[1:]
@@ -199,7 +199,7 @@ class TablesTest(TestBase):
continue
cls.bind.execute(
table.insert(),
- [dict(zip(headers[table], column_values))
+ [dict(list(zip(headers[table], column_values)))
for column_values in rows[table]])
@@ -284,8 +284,8 @@ class MappedTest(_ORMTest, TablesTest, assertions.AssertsExecutionResults):
cls_registry[classname] = cls
return type.__init__(cls, classname, bases, dict_)
- class _Base(object):
- __metaclass__ = FindFixture
+ class _Base(object, metaclass=FindFixture):
+ pass
class Basic(BasicEntity, _Base):
pass