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 /lib/sqlalchemy/testing/fixtures.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 'lib/sqlalchemy/testing/fixtures.py')
-rw-r--r-- | lib/sqlalchemy/testing/fixtures.py | 16 |
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 |