summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/assertions.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r--lib/sqlalchemy/testing/assertions.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py
index e0c02c896..21dc3e71a 100644
--- a/lib/sqlalchemy/testing/assertions.py
+++ b/lib/sqlalchemy/testing/assertions.py
@@ -50,8 +50,6 @@ def expect_warnings_on(db, *messages, **kw):
if isinstance(db, util.string_types) and not spec(config._current):
yield
- elif not _is_excluded(*db):
- yield
else:
with expect_warnings(*messages, **kw):
yield
@@ -90,7 +88,7 @@ def emits_warning_on(db, *messages):
"""
@decorator
def decorate(fn, *args, **kw):
- with expect_warnings_on(db, *messages):
+ with expect_warnings_on(db, assert_=False, *messages):
return fn(*args, **kw)
return decorate
@@ -231,6 +229,16 @@ def is_not_(a, b, msg=None):
assert a is not b, msg or "%r is %r" % (a, b)
+def in_(a, b, msg=None):
+ """Assert a in b, with repr messaging on failure."""
+ assert a in b, msg or "%r not in %r" % (a, b)
+
+
+def not_in_(a, b, msg=None):
+ """Assert a in not b, with repr messaging on failure."""
+ assert a not in b, msg or "%r is in %r" % (a, b)
+
+
def startswith_(a, fragment, msg=None):
"""Assert a.startswith(fragment), with repr messaging on failure."""
assert a.startswith(fragment), msg or "%r does not start with %r" % (