From 2608838ef1f96b0c8d3ff3ed4310eaa63ba73031 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Sun, 4 Jan 2009 03:52:08 -0700 Subject: Quite a bit of work on new public errors and their unit tests --- tests/util.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/util.py') diff --git a/tests/util.py b/tests/util.py index 66236cbb4..b0961f453 100644 --- a/tests/util.py +++ b/tests/util.py @@ -99,6 +99,14 @@ class ExceptionNotRaised(Exception): return self.msg % self.expected.__name__ +def assert_equal(val1, val2): + """ + Assert ``val1`` and ``val2`` are the same type and of equal value. + """ + assert type(val1) is type(val2), '%r != %r' % (val1, val2) + assert val1 == val2, '%r != %r' % (val1, val2) + + def raises(exception, callback, *args, **kw): """ Tests that the expected exception is raised; raises ExceptionNotRaised -- cgit