summaryrefslogtreecommitdiff
path: root/test/DocutilsTestSupport.py
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2012-10-25 11:48:32 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2012-10-25 11:48:32 +0000
commit0b2373753a0efd4a609f96d75ae6fbda7d31d508 (patch)
tree3618467667e990e2a6ab51bb7439ed2ddcfa2bf2 /test/DocutilsTestSupport.py
parent23082f06d9e9a0e9ac445117eb55df1922a4af0e (diff)
downloaddocutils-0b2373753a0efd4a609f96d75ae6fbda7d31d508.tar.gz
Code cleanup and test html math output options.
Based on patch by Dmitry Shachnev. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@7534 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/DocutilsTestSupport.py')
-rw-r--r--test/DocutilsTestSupport.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/DocutilsTestSupport.py b/test/DocutilsTestSupport.py
index 2988768b6..e410070d4 100644
--- a/test/DocutilsTestSupport.py
+++ b/test/DocutilsTestSupport.py
@@ -119,16 +119,28 @@ class StandardTestCase(unittest.TestCase):
operator.
"""
if not first == second:
- raise self.failureException, \
- (msg or '%s != %s' % _format_str(first, second))
+ raise self.failureException, (
+ msg or '%s != %s' % _format_str(first, second))
def assertNotEqual(self, first, second, msg=None):
"""Fail if the two objects are equal as determined by the '=='
operator.
"""
if first == second:
- raise self.failureException, \
- (msg or '%s == %s' % _format_str(first, second))
+ raise self.failureException, (
+ msg or '%s == %s' % _format_str(first, second))
+
+ # assertIn and assertNotIn: new in Python 2.7:
+
+ def assertIn(self, a, b, msg=None):
+ if a not in b:
+ raise self.failureException, (
+ msg or '%s not in %s' % _format_str(a, b))
+
+ def assertNotIn(self, a, b, msg=None):
+ if a in b:
+ raise self.failureException, (
+ msg or '%s in %s' % _format_str(a, b))
# aliases for assertion methods, deprecated since Python 2.7