diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-17 16:53:01 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-17 16:53:01 -0500 |
commit | 2965da0a5d89119787bd45ac6f5459a7b755656d (patch) | |
tree | a9444e1311b5b39d736ce1d248d464b95c27a9aa /lib/sqlalchemy/testing/assertions.py | |
parent | bf1d03a9e58a0256db0b1f7389e23a6d11c4a964 (diff) | |
download | sqlalchemy-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.py | 4 |
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) |