Mercurial > hgsubversion
comparison tests/test_util.py @ 744:6d6be5284056
tests: make assertMultiLineEqual call super, if possible.
Python 2.7 provides such a method.
| author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
|---|---|
| date | Thu, 11 Nov 2010 21:30:31 +0100 |
| parents | 045120d3a110 |
| children | c31a1f92e1c6 |
comparison
equal
deleted
inserted
replaced
| 743:045120d3a110 | 744:6d6be5284056 |
|---|---|
| 403 self.assertEqual(copy[0], source) | 403 self.assertEqual(copy[0], source) |
| 404 | 404 |
| 405 def assertMultiLineEqual(self, first, second, msg=None): | 405 def assertMultiLineEqual(self, first, second, msg=None): |
| 406 """Assert that two multi-line strings are equal. (Based on Py3k code.) | 406 """Assert that two multi-line strings are equal. (Based on Py3k code.) |
| 407 """ | 407 """ |
| 408 try: | |
| 409 return super(TestBase, self).assertMultiLineEqual(first, second, | |
| 410 msg) | |
| 411 except AttributeError: | |
| 412 pass | |
| 413 | |
| 408 self.assert_(isinstance(first, str), | 414 self.assert_(isinstance(first, str), |
| 409 ('First argument is not a string')) | 415 ('First argument is not a string')) |
| 410 self.assert_(isinstance(second, str), | 416 self.assert_(isinstance(second, str), |
| 411 ('Second argument is not a string')) | 417 ('Second argument is not a string')) |
| 412 | 418 |
