From 6bdd98622e88bed3ede325b0ffc2bb8d63cde52f Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sat, 23 Nov 2013 21:14:42 +0200 Subject: #10712: 2to3 has a new "asserts" fixer that replaces deprecated names of unittest methods. --- Doc/library/2to3.rst | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'Doc') diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst index fda214c15e..1092e6b620 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) + ` + ``assertEquals(a, b)`` :meth:`assertEqual(a, b) + ` + ``failIfEqual(a, b)`` :meth:`assertNotEqual(a, b) + ` + ``assertNotEquals(a, b)`` :meth:`assertNotEqual(a, b) + ` + ``failUnless(a)`` :meth:`assertTrue(a) + ` + ``assert_(a)`` :meth:`assertTrue(a) + ` + ``failIf(a)`` :meth:`assertFalse(a) + ` + ``failUnlessRaises(exc, cal)`` :meth:`assertRaises(exc, cal) + ` + ``failUnlessAlmostEqual(a, b)`` :meth:`assertAlmostEqual(a, b) + ` + ``assertAlmostEquals(a, b)`` :meth:`assertAlmostEqual(a, b) + ` + ``failIfAlmostEqual(a, b)`` :meth:`assertNotAlmostEqual(a, b) + ` + ``assertNotAlmostEquals(a, b)`` :meth:`assertNotAlmostEqual(a, b) + ` + ================================ ========================================== + .. 2to3fixer:: basestring Converts :class:`basestring` to :class:`str`. -- cgit v1.2.1