diff options
Diffstat (limited to 'Doc/library/2to3.rst')
-rw-r--r-- | Doc/library/2to3.rst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst index 1e5f42d..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`. @@ -342,6 +375,10 @@ and off individually. They are described here in more detail. Handles the move of :func:`reduce` to :func:`functools.reduce`. +.. 2to3fixer:: reload + + Converts :func:`reload` to :func:`imp.reload`. + .. 2to3fixer:: renames Changes :data:`sys.maxint` to :data:`sys.maxsize`. |