summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/fixtures.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-28 14:08:28 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-28 14:08:28 -0400
commit18370ac032a84da539c54640a425c0fca7613dc9 (patch)
tree588c35d5fd126c7438bc49374f657e7edd9c055b /lib/sqlalchemy/testing/fixtures.py
parentd37431d7a5f7c930527ad9418756d102adebffdb (diff)
downloadsqlalchemy-18370ac032a84da539c54640a425c0fca7613dc9.tar.gz
- endless isinstance(x, str)s....
Diffstat (limited to 'lib/sqlalchemy/testing/fixtures.py')
-rw-r--r--lib/sqlalchemy/testing/fixtures.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py
index 08b2361f2..daa779ae3 100644
--- a/lib/sqlalchemy/testing/fixtures.py
+++ b/lib/sqlalchemy/testing/fixtures.py
@@ -1,6 +1,7 @@
from . import config
from . import assertions, schema
from .util import adict
+from .. import util
from .engines import drop_all_tables
from .entities import BasicEntity, ComparableEntity
import sys
@@ -126,8 +127,9 @@ class TablesTest(TestBase):
try:
table.delete().execute().close()
except sa.exc.DBAPIError as ex:
- print("Error emptying table %s: %r" % (
- table, ex), file=sys.stderr)
+ util.print_(
+ ("Error emptying table %s: %r" % (table, ex)),
+ file=sys.stderr)
def setup(self):
self._setup_each_tables()
@@ -190,7 +192,7 @@ class TablesTest(TestBase):
for table, data in cls.fixtures().items():
if len(data) < 2:
continue
- if isinstance(table, str):
+ if isinstance(table, util.string_types):
table = cls.tables[table]
headers[table] = data[0]
rows[table] = data[1:]
@@ -199,7 +201,7 @@ class TablesTest(TestBase):
continue
cls.bind.execute(
table.insert(),
- [dict(list(zip(headers[table], column_values)))
+ [dict(zip(headers[table], column_values))
for column_values in rows[table]])
@@ -284,7 +286,7 @@ class MappedTest(_ORMTest, TablesTest, assertions.AssertsExecutionResults):
cls_registry[classname] = cls
return type.__init__(cls, classname, bases, dict_)
- class _Base(object, metaclass=FindFixture):
+ class _Base(util.with_metaclass(FindFixture, object)):
pass
class Basic(BasicEntity, _Base):