From 2965da0a5d89119787bd45ac6f5459a7b755656d Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 17 Feb 2016 16:53:01 -0500 Subject: - 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) --- lib/sqlalchemy/testing/assertions.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/testing/assertions.py') 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) -- cgit v1.2.1