From 20cdc64588b0f6ae52f8380c11d0ed848005377b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 27 Sep 2012 02:37:33 -0400 Subject: trying different approaches to test layout. in this one, the testing modules become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries. --- lib/sqlalchemy/testing/requirements.py | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/sqlalchemy/testing/requirements.py (limited to 'lib/sqlalchemy/testing/requirements.py') diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py new file mode 100644 index 000000000..eca883d4e --- /dev/null +++ b/lib/sqlalchemy/testing/requirements.py @@ -0,0 +1,38 @@ +"""Global database feature support policy. + +Provides decorators to mark tests requiring specific feature support from the +target database. + +""" + +from .exclusions import \ + skip, \ + skip_if,\ + only_if,\ + only_on,\ + fails_on,\ + fails_on_everything_except,\ + fails_if,\ + SpecPredicate,\ + against + +def no_support(db, reason): + return SpecPredicate(db, description=reason) + +def exclude(db, op, spec, description=None): + return SpecPredicate(db, op, spec, description=description) + + +def _chain_decorators_on(*decorators): + def decorate(fn): + for decorator in reversed(decorators): + fn = decorator(fn) + return fn + return decorate + +class Requirements(object): + def __init__(self, db, config): + self.db = db + self.config = config + + -- cgit v1.2.1