summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/assertions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-02-17 16:53:01 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-02-17 16:53:01 -0500
commit2965da0a5d89119787bd45ac6f5459a7b755656d (patch)
treea9444e1311b5b39d736ce1d248d464b95c27a9aa /lib/sqlalchemy/testing/assertions.py
parentbf1d03a9e58a0256db0b1f7389e23a6d11c4a964 (diff)
downloadsqlalchemy-2965da0a5d89119787bd45ac6f5459a7b755656d.tar.gz
- handle parameter sets that aren't correctly formed, so that
for example an exception object made within a test suite can still repr (error seen in Keystone)
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r--lib/sqlalchemy/testing/assertions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py
index 21f9f68fb..ea50c0738 100644
--- a/lib/sqlalchemy/testing/assertions.py
+++ b/lib/sqlalchemy/testing/assertions.py
@@ -204,6 +204,10 @@ def _assert_no_stray_pool_connections():
_STRAY_CONNECTION_FAILURES = 0
+def eq_regex(a, b, msg=None):
+ assert re.match(b, a), msg or "%r !~ %r" % (a, b)
+
+
def eq_(a, b, msg=None):
"""Assert a == b, with repr messaging on failure."""
assert a == b, msg or "%r != %r" % (a, b)