diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2019-08-26 16:42:23 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2019-08-26 16:42:23 +0000 |
| commit | 1c9f515466b7648fbfef8607d9360211e977b05a (patch) | |
| tree | 4256b9ea2e23d7c3c406a53ce70c0fbf63da2219 /docutils/test | |
| parent | 960f5935e9319d3348d7ddb32f6608a3c120426c (diff) | |
| download | docutils-1c9f515466b7648fbfef8607d9360211e977b05a.tar.gz | |
py3: Replace deprecated form of raising exception
Signed-off-by: Stephen Finucane <stephen@that.guru>
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8353 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 21 | ||||
| -rw-r--r-- | docutils/test/package_unittest.py | 2 |
2 files changed, 5 insertions, 18 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index eb9b8fa39..2d40989f5 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -123,30 +123,17 @@ 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: - if sys.version_info < (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 failUnlessEqual = assertEquals = assertEqual diff --git a/docutils/test/package_unittest.py b/docutils/test/package_unittest.py index 57b6c945b..9c35723ab 100644 --- a/docutils/test/package_unittest.py +++ b/docutils/test/package_unittest.py @@ -120,7 +120,7 @@ def loadTestModules(path, name='', packages=None): elif isinstance(suite, unittest.TestSuite): testSuite.addTest(suite) else: - raise AssertionError, "don't understand suite (%s)" % mod + raise AssertionError("don't understand suite (%s)" % mod) sys.path.pop(0) return testSuite |
