From b3c9eb645d459b1cbfa3ce39a06bc280968448f4 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Wed, 10 May 2017 19:00:02 +0300 Subject: [PATCH 1/4] Add deprecation alias entry for assertNotRegexpMatches --- Doc/library/unittest.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 92e567d12824fa..dcc56ffa3db6de 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1164,12 +1164,10 @@ Test cases expression suitable for use by :func:`re.search`. .. versionadded:: 3.1 - under the name ``assertRegexpMatches``. + under the names ``assertRegexpMatches`` and ``assertNotRegexpMatches``. .. versionchanged:: 3.2 - The method ``assertRegexpMatches()`` has been renamed to - :meth:`.assertRegex`. - .. versionadded:: 3.2 - :meth:`.assertNotRegex`. + The methods ``assertRegexpMatches()`` and ``assertNotRegexpMatches`` + have been renamed to :meth:`.assertRegex` and :meth:`.assertNotRegex`. .. method:: assertCountEqual(first, second, msg=None) @@ -1435,9 +1433,9 @@ For historical reasons, some of the :class:`TestCase` methods had one or more aliases that are now deprecated. The following table lists the correct names along with their deprecated aliases: - ============================== ====================== ====================== + ============================== ====================== ======================= Method Name Deprecated alias Deprecated alias - ============================== ====================== ====================== + ============================== ====================== ======================= :meth:`.assertEqual` failUnlessEqual assertEquals :meth:`.assertNotEqual` failIfEqual assertNotEquals :meth:`.assertTrue` failUnless assert\_ @@ -1446,16 +1444,18 @@ along with their deprecated aliases: :meth:`.assertAlmostEqual` failUnlessAlmostEqual assertAlmostEquals :meth:`.assertNotAlmostEqual` failIfAlmostEqual assertNotAlmostEquals :meth:`.assertRegex` assertRegexpMatches + :meth:`.assertNotRegex` assertNotRegexpMatches :meth:`.assertRaisesRegex` assertRaisesRegexp - ============================== ====================== ====================== + ============================== ====================== ======================= .. deprecated:: 3.1 the fail* aliases listed in the second column. .. deprecated:: 3.2 the assert* aliases listed in the third column. .. deprecated:: 3.2 - ``assertRegexpMatches`` and ``assertRaisesRegexp`` have been renamed to - :meth:`.assertRegex` and :meth:`.assertRaisesRegex` + ``assertRegexpMatches``, ``assertNotRegexpMatches`` and + ``assertRaisesRegexp`` have been renamed to :meth:`.assertRegex`, + :meth:`.assertNotRegex` and :meth:`.assertRaisesRegex`. .. _testsuite-objects: From 31a90b25118b6321679e928494267188b57ab8c4 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Fri, 12 May 2017 08:10:57 +0300 Subject: [PATCH 2/4] Fix versionadded and deprecated directives --- Doc/library/unittest.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index dcc56ffa3db6de..26959ac3701dc0 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1164,10 +1164,13 @@ Test cases expression suitable for use by :func:`re.search`. .. versionadded:: 3.1 - under the names ``assertRegexpMatches`` and ``assertNotRegexpMatches``. + under the name ``assertRegexpMatches``. .. versionchanged:: 3.2 - The methods ``assertRegexpMatches()`` and ``assertNotRegexpMatches`` - have been renamed to :meth:`.assertRegex` and :meth:`.assertNotRegex`. + The method ``assertRegexpMatches()`` has been renamed to + :meth:`.assertRegex`. + .. versionadded:: 3.5 + The name ``assertNotRegexpMatches`` as a deprecated alias + for :meth:`.assertNotRegex`. .. method:: assertCountEqual(first, second, msg=None) @@ -1453,10 +1456,10 @@ along with their deprecated aliases: .. deprecated:: 3.2 the assert* aliases listed in the third column. .. deprecated:: 3.2 - ``assertRegexpMatches``, ``assertNotRegexpMatches`` and - ``assertRaisesRegexp`` have been renamed to :meth:`.assertRegex`, - :meth:`.assertNotRegex` and :meth:`.assertRaisesRegex`. - + ``assertRegexpMatches`` and ``assertRaisesRegexp`` have been renamed to + :meth:`.assertRegex` and :meth:`.assertRaisesRegex`. + .. deprecated:: 3.5 + the ``assertNotRegexpMatches`` name in favor of :meth:`.assertNotRegex`. .. _testsuite-objects: From b53f1929e6fed49c44559f067f8c8eac92e9e3c6 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Fri, 12 May 2017 08:15:23 +0300 Subject: [PATCH 3/4] Revert previously removed versionadded for assertNotRegex(). --- Doc/library/unittest.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 26959ac3701dc0..ca7a49188bb5e8 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1168,6 +1168,8 @@ Test cases .. versionchanged:: 3.2 The method ``assertRegexpMatches()`` has been renamed to :meth:`.assertRegex`. + .. versionadded:: 3.2 + :meth:`.assertNotRegex`. .. versionadded:: 3.5 The name ``assertNotRegexpMatches`` as a deprecated alias for :meth:`.assertNotRegex`. From 7cf3a6db8c6acc5239e38c5f75a3e361440a9abd Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Sat, 13 May 2017 18:25:50 +0300 Subject: [PATCH 4/4] Adress review, 'as a' -> 'is a' --- Doc/library/unittest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index ca7a49188bb5e8..2099bd1e2e979c 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1171,7 +1171,7 @@ Test cases .. versionadded:: 3.2 :meth:`.assertNotRegex`. .. versionadded:: 3.5 - The name ``assertNotRegexpMatches`` as a deprecated alias + The name ``assertNotRegexpMatches`` is a deprecated alias for :meth:`.assertNotRegex`.