Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8f2e07b7
Commit
8f2e07b7
authored
Nov 04, 2010
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the deprecated aliases in a new section.
parent
27bbca6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
30 deletions
+24
-30
Doc/library/unittest.rst
Doc/library/unittest.rst
+24
-30
No files found.
Doc/library/unittest.rst
View file @
8f2e07b7
...
...
@@ -809,7 +809,6 @@ Test cases
.. method:: assertEqual(first, second, msg=None)
failUnlessEqual(first, second, msg=None)
Test that *first* and *second* are equal. If the values do not compare
equal, the test will fail with the explanation given by *msg*, or
...
...
@@ -831,12 +830,8 @@ Test cases
:meth:`assertMultiLineEqual` added as the default type equality
function for comparing strings.
.. deprecated:: 3.1
:meth:`failUnlessEqual`; use :meth:`assertEqual`.
.. method:: assertNotEqual(first, second, msg=None)
failIfEqual(first, second, msg=None)
Test that *first* and *second* are not equal. If the values do compare
equal, the test will fail with the explanation given by *msg*, or
...
...
@@ -845,31 +840,19 @@ Test cases
default value for *msg* can be computed to include representations of both
*first* and *second*.
.. deprecated:: 3.1
:meth:`failIfEqual`; use :meth:`assertNotEqual`.
.. method:: assertTrue(expr, msg=None)
assert_(expr, msg=None)
failUnless(expr, msg=None)
Signal a test failure if *expr* is false; the explanation for the failure
will be *msg* if given, otherwise it will be :const:`None`.
.. deprecated:: 3.1
:meth:`failUnless` and :meth:`assert_`; use :meth:`assertTrue`.
.. method:: assertFalse(expr, msg=None)
failIf(expr, msg=None)
The inverse of the :meth:`assertTrue` method is the :meth:`assertFalse` method.
This signals a test failure if *expr* is true, with *msg* or :const:`None`
for the error message.
.. deprecated:: 3.1
:meth:`failIf`; use :meth:`assertFalse`.
.. method:: assertIs(first, second, msg=None)
assertIsNot(first, second, msg=None)
...
...
@@ -929,9 +912,7 @@ Test cases
+---------------------------------------------------------+--------------------------------------+------------+
.. method:: assertRaises(exception, callable, *args, **kwds)
failUnlessRaises(exception, callable, *args, **kwds)
assertRaises(exception)
failUnlessRaises(exception)
Test that an exception is raised when *callable* is called with any
positional or keyword arguments that are also passed to
...
...
@@ -962,9 +943,6 @@ Test cases
.. versionchanged:: 3.2
Added the :attr:`exception` attribute.
.. deprecated:: 3.1
:meth:`failUnlessRaises`; use :meth:`assertRaises`.
.. method:: assertRaisesRegexp(exception, regexp, callable, *args, **kwds)
assertRaisesRegexp(exception, regexp)
...
...
@@ -1079,7 +1057,6 @@ Test cases
.. method:: assertAlmostEqual(first, second, places=7, msg=None, delta=None)
failUnlessAlmostEqual(first, second, places=7, msg=None, delta=None)
Test that *first* and *second* are approximately equal by computing the
difference, rounding to the given number of decimal *places* (default 7),
...
...
@@ -1099,12 +1076,8 @@ Test cases
Objects that compare equal are automatically almost equal.
Added the ``delta`` keyword argument.
.. deprecated:: 3.1
:meth:`failUnlessAlmostEqual`; use :meth:`assertAlmostEqual`.
.. method:: assertNotAlmostEqual(first, second, places=7, msg=None, delta=None)
failIfAlmostEqual(first, second, places=7, msg=None, delta=None)
Test that *first* and *second* are not approximately equal by computing
the difference, rounding to the given number of decimal *places* (default
...
...
@@ -1124,9 +1097,6 @@ Test cases
Objects that compare equal automatically fail. Added the ``delta``
keyword argument.
.. deprecated:: 3.1
:meth:`failIfAlmostEqual`; use :meth:`assertNotAlmostEqual`.
.. method:: assertGreater(first, second, msg=None)
assertGreaterEqual(first, second, msg=None)
...
...
@@ -1452,6 +1422,30 @@ Test cases
:mod:`unittest`-based test framework.
Deprecated aliases
##################
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(es)
============================== ===============================
:meth:`.assertEqual` failUnlessEqual, assertEquals
:meth:`.assertNotEqual` failIfEqual
:meth:`.assertTrue` failUnless, assert\_
:meth:`.assertFalse` failIf
:meth:`.assertRaises` failUnlessRaises
:meth:`.assertAlmostEqual` failUnlessAlmostEqual
:meth:`.assertNotAlmostEqual` failIfAlmostEqual
============================== ===============================
.. deprecated:: 3.1
the aliases listed in the second column
.. _testsuite-objects:
Grouping tests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment