summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-02-15 19:09:21 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-02-15 19:09:21 +0000
commit7eeb1412d3ad34a7fc3ec65ba48252ff10b72669 (patch)
treef23a909b2a12a732484e4d9d978493f99b3f075b
parent563972b0ffcdfd583208bf7c541b1c102c8ec230 (diff)
downloadsqlalchemy-7eeb1412d3ad34a7fc3ec65ba48252ff10b72669.tar.gz
exclude this test for everyone but sqlite
-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()()