summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/test/testing.py19
-rw-r--r--test/aaa_profiling/test_orm.py2
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/sqlalchemy/test/testing.py b/lib/sqlalchemy/test/testing.py
index ea1dfa9ea..1b4e1f78c 100644
--- a/lib/sqlalchemy/test/testing.py
+++ b/lib/sqlalchemy/test/testing.py
@@ -207,7 +207,24 @@ def _block_unconditionally(db, reason):
return function_named(maybe, fn_name)
return decorate
-
+def only_on(db, reason):
+ carp = _should_carp_about_exclusion(reason)
+ spec = db_spec(db)
+ def decorate(fn):
+ fn_name = fn.__name__
+ def maybe(*args, **kw):
+ if spec(config.db):
+ return fn(*args, **kw)
+ else:
+ msg = "'%s' unsupported on DB implementation '%s+%s': %s" % (
+ fn_name, config.db.name, config.db.driver, reason)
+ print msg
+ if carp:
+ print >> sys.stderr, msg
+ return True
+ return function_named(maybe, fn_name)
+ return decorate
+
def exclude(db, op, spec, reason):
"""Mark a test as unsupported by specific database server versions.
diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py
index 3d32bb011..72aa29ca0 100644
--- a/test/aaa_profiling/test_orm.py
+++ b/test/aaa_profiling/test_orm.py
@@ -72,7 +72,7 @@ class MergeTest(_base.MappedTest):
p3 = go()
- @testing.fails_on_everything_except('sqlite')
+ @testing.only_on('sqlite', 'Call counts tailored to pysqlite')
@testing.resolve_artifact_names
def test_merge_load(self):
sess = sessionmaker()()