summaryrefslogtreecommitdiffstats
path: root/Doc/library/unittest.rst
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-02-08 22:41:16 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-02-08 22:41:16 (GMT)
commitfe6349c96505d874ed68eb85e61a833bb6a858af (patch)
treee05bc747c0ec35a8bed1cf8cbf28e44a65bb0418 /Doc/library/unittest.rst
parent0c4783a33c9c89b7c17a6b122e8cc72152609b6e (diff)
downloadcpython-fe6349c96505d874ed68eb85e61a833bb6a858af.zip
cpython-fe6349c96505d874ed68eb85e61a833bb6a858af.tar.gz
cpython-fe6349c96505d874ed68eb85e61a833bb6a858af.tar.bz2
Make assertMultiLineEqual the default for comparing unicode strings.
Diffstat (limited to 'Doc/library/unittest.rst')
-rw-r--r--Doc/library/unittest.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index b1d27d2..90f5bec 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -695,7 +695,7 @@ Test cases
*second*.
In addition, if *first* and *second* are the exact same type and one of
- list, tuple, dict, set, or frozenset or any type that a subclass
+ list, tuple, dict, set, frozenset or unicode or any type that a subclass
registers :meth:`addTypeEqualityFunc` the type specific equality function
will be called in order to generate a more useful default error message.
@@ -777,7 +777,8 @@ Test cases
Test that the multiline string *first* is equal to the string *second*.
When not equal a diff of the two strings highlighting the differences
- will be included in the error message.
+ will be included in the error message. This method is used by default
+ when comparing Unicode strings with :meth:`assertEqual`.
If specified *msg* will be used as the error message on failure.
@@ -823,7 +824,8 @@ Test cases
.. method:: assertSetEqual(set1, set2, msg=None)
Tests that two sets are equal. If not, an error message is constructed
- that lists the differences between the sets.
+ that lists the differences between the sets. This method is used by
+ default when comparing sets or frozensets with :meth:`assertEqual`.
Fails if either of *set1* or *set2* does not have a :meth:`set.difference`
method.
@@ -836,7 +838,9 @@ Test cases
.. method:: assertDictEqual(expected, actual, msg=None)
Test that two dictionaries are equal. If not, an error message is
- constructed that shows the differences in the dictionaries.
+ constructed that shows the differences in the dictionaries. This
+ method will be used by default to compare dictionaries in
+ calls to :meth:`assertEqual`.
If specified *msg* will be used as the error message on failure.
@@ -860,6 +864,8 @@ Test cases
Tests that two lists or tuples are equal. If not an error message is
constructed that shows only the differences between the two. An error
is also raised if either of the parameters are of the wrong type.
+ These methods are used by default when comparing lists or tuples with
+ :meth:`assertEqual`.
If specified *msg* will be used as the error message on failure.