diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-11-23 19:14:42 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-11-23 19:14:42 (GMT) |
commit | 6bdd98622e88bed3ede325b0ffc2bb8d63cde52f (patch) | |
tree | 6ade26a10db633cd32dd09e7d3a94f0fd51004f5 /Doc/library/2to3.rst | |
parent | 7571941db6591c7521311274f0ea3c83657eb911 (diff) | |
download | cpython-6bdd98622e88bed3ede325b0ffc2bb8d63cde52f.zip cpython-6bdd98622e88bed3ede325b0ffc2bb8d63cde52f.tar.gz cpython-6bdd98622e88bed3ede325b0ffc2bb8d63cde52f.tar.bz2 |
#10712: 2to3 has a new "asserts" fixer that replaces deprecated names of unittest methods.
Diffstat (limited to 'Doc/library/2to3.rst')
-rw-r--r-- | Doc/library/2to3.rst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst index fda214c..1092e6b 100644 --- a/Doc/library/2to3.rst +++ b/Doc/library/2to3.rst @@ -142,6 +142,39 @@ and off individually. They are described here in more detail. Removes usage of :func:`apply`. For example ``apply(function, *args, **kwargs)`` is converted to ``function(*args, **kwargs)``. +.. 2to3fixer:: asserts + + Replaces deprecated :mod:`unittest` method names with the correct ones. + + ================================ ========================================== + From To + ================================ ========================================== + ``failUnlessEqual(a, b)`` :meth:`assertEqual(a, b) + <unittest.TestCase.assertEqual>` + ``assertEquals(a, b)`` :meth:`assertEqual(a, b) + <unittest.TestCase.assertEqual>` + ``failIfEqual(a, b)`` :meth:`assertNotEqual(a, b) + <unittest.TestCase.assertNotEqual>` + ``assertNotEquals(a, b)`` :meth:`assertNotEqual(a, b) + <unittest.TestCase.assertNotEqual>` + ``failUnless(a)`` :meth:`assertTrue(a) + <unittest.TestCase.assertTrue>` + ``assert_(a)`` :meth:`assertTrue(a) + <unittest.TestCase.assertTrue>` + ``failIf(a)`` :meth:`assertFalse(a) + <unittest.TestCase.assertFalse>` + ``failUnlessRaises(exc, cal)`` :meth:`assertRaises(exc, cal) + <unittest.TestCase.assertRaises>` + ``failUnlessAlmostEqual(a, b)`` :meth:`assertAlmostEqual(a, b) + <unittest.TestCase.assertAlmostEqual>` + ``assertAlmostEquals(a, b)`` :meth:`assertAlmostEqual(a, b) + <unittest.TestCase.assertAlmostEqual>` + ``failIfAlmostEqual(a, b)`` :meth:`assertNotAlmostEqual(a, b) + <unittest.TestCase.assertNotAlmostEqual>` + ``assertNotAlmostEquals(a, b)`` :meth:`assertNotAlmostEqual(a, b) + <unittest.TestCase.assertNotAlmostEqual>` + ================================ ========================================== + .. 2to3fixer:: basestring Converts :class:`basestring` to :class:`str`. |