summaryrefslogtreecommitdiffstats
path: root/Doc/library/unittest.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-11 20:45:40 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-11 20:45:40 (GMT)
commitf47ed4a01462b304199c806d3d1a4d0a5e311e2f (patch)
tree7bbd769a1fd70399bf86ca31a697b640626729ca /Doc/library/unittest.rst
parenta0a7faab91e8618ca47dbb9144a660c303036849 (diff)
downloadcpython-f47ed4a01462b304199c806d3d1a4d0a5e311e2f.zip
cpython-f47ed4a01462b304199c806d3d1a4d0a5e311e2f.tar.gz
cpython-f47ed4a01462b304199c806d3d1a4d0a5e311e2f.tar.bz2
Merged revisions 70912,70944,70968,71033,71041,71208,71263,71286,71395-71396,71405-71406,71485,71492,71494 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r70912 | georg.brandl | 2009-03-31 17:35:46 -0500 (Tue, 31 Mar 2009) | 1 line #5617: add a handy function to print a unicode string to gdbinit. ........ r70944 | georg.brandl | 2009-03-31 23:32:39 -0500 (Tue, 31 Mar 2009) | 1 line #5631: add upload to list of possible commands, which is presented in --help-commands. ........ r70968 | michael.foord | 2009-04-01 13:25:38 -0500 (Wed, 01 Apr 2009) | 1 line Adding Wing project file ........ r71033 | brett.cannon | 2009-04-01 22:34:53 -0500 (Wed, 01 Apr 2009) | 3 lines Fix two issues introduced by issue #71031 by changing the signature of PyImport_AppendInittab() to take a const char *. ........ r71041 | jesse.noller | 2009-04-02 00:17:26 -0500 (Thu, 02 Apr 2009) | 1 line Add custom initializer argument to multiprocess.Manager*, courtesy of lekma ........ r71208 | michael.foord | 2009-04-04 20:15:01 -0500 (Sat, 04 Apr 2009) | 4 lines Change the way unittest.TestSuite use their tests to always access them through iteration. Non behavior changing, this allows you to create custom subclasses that override __iter__. Issue #5693 ........ r71263 | michael.foord | 2009-04-05 14:19:28 -0500 (Sun, 05 Apr 2009) | 4 lines Adding assertIs and assertIsNot methods to unittest.TestCase Issue #2578 ........ r71286 | tarek.ziade | 2009-04-05 17:04:38 -0500 (Sun, 05 Apr 2009) | 1 line added a simplest test to distutils.spawn._nt_quote_args ........ r71395 | benjamin.peterson | 2009-04-08 08:27:29 -0500 (Wed, 08 Apr 2009) | 1 line these must be installed to correctly run tests ........ r71396 | benjamin.peterson | 2009-04-08 08:29:41 -0500 (Wed, 08 Apr 2009) | 1 line fix syntax ........ r71405 | andrew.kuchling | 2009-04-09 06:22:47 -0500 (Thu, 09 Apr 2009) | 1 line Add items ........ r71406 | andrew.kuchling | 2009-04-09 06:23:36 -0500 (Thu, 09 Apr 2009) | 1 line Typo fixes ........ r71485 | andrew.kuchling | 2009-04-11 11:12:23 -0500 (Sat, 11 Apr 2009) | 1 line Add various items ........ r71492 | georg.brandl | 2009-04-11 13:19:27 -0500 (Sat, 11 Apr 2009) | 1 line Take credit for a patch of mine. ........ r71494 | benjamin.peterson | 2009-04-11 14:31:00 -0500 (Sat, 11 Apr 2009) | 1 line ignore py3_test_grammar when compiling the library ........
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r--Doc/library/unittest.rst29
1 files changed, 23 insertions, 6 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index f5888d8..4ecf476 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -689,7 +689,7 @@ Test cases
assertLessEqual(first, second, msg=None)
Test that *first* is respectively >, >=, < or <= than *second* depending
- on the method name. If not, the test will fail with the nice explanation
+ on the method name. If not, the test will fail with an explanation
or with the explanation given by *msg*::
>>> self.assertGreaterEqual(3, 4)
@@ -722,7 +722,7 @@ Test cases
.. method:: assertIn(first, second, msg=None)
assertNotIn(first, second, msg=None)
- Tests that *first* is or is not in *second* with a nice explanitory error
+ Tests that *first* is or is not in *second* with an explanatory error
message as appropriate.
If specified *msg* will be used as the error message on failure.
@@ -766,7 +766,7 @@ Test cases
.. method:: assertDictContainsSubset(expected, actual, msg=None)
- Tests whether the key value pairs in dictionary *actual* are a
+ Tests whether the key/value pairs in dictionary *actual* are a
superset of those in *expected*. If not, an error message listing
the missing keys and mismatched values is generated.
@@ -858,6 +858,23 @@ Test cases
.. versionadded:: 3.1
+ .. method:: assertIs(expr1, expr2[, msg])
+
+ This signals a test failure if *expr1* and *expr2* don't evaluate to the same
+ object.
+
+ .. versionadded:: 2.7
+
+
+ .. method:: assertIsNot(expr1, expr2[, msg])
+
+ The inverse of the :meth:`assertIs` method.
+ This signals a test failure if *expr1* and *expr2* evaluate to the same
+ object.
+
+ .. versionadded:: 2.7
+
+
.. method:: assertFalse(expr[, msg])
failIf(expr[, msg])
@@ -951,12 +968,12 @@ Test cases
been asked to compare are exactly *typeobj* (not subclasses).
*function* must take two positional arguments and a third msg=None
keyword argument just as :meth:`assertEqual` does. It must raise
- self.failureException when inequality between the first two
+ ``self.failureException`` when inequality between the first two
parameters is detected.
One good use of custom equality checking functions for a type
- is to raise self.failureException with an error message useful
- for debugging the by explaining the inequalities in detail.
+ is to raise ``self.failureException`` with an error message useful
+ for debugging the problem by explaining the inequalities in detail.
.. versionadded:: 3.1