will be included in the error message. This method is used by default
when comparing strings with :meth:`assertEqual`.
- If specified *msg* will be used as the error message on failure.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
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.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
Duplicate elements are ignored when comparing *actual* and *expected*.
It is the equivalent of ``assertEqual(set(expected), set(actual))``
- but it works with sequences of unhashable objects as well.
+ but it works with sequences of unhashable objects as well. Because
+ duplicates are ignored, this method has been deprecated in favour of
+ :meth:`assertItemsEqual`.
- If specified *msg* will be used as the error message on failure.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
+ .. deprecated:: 3.2
+
+ .. method:: assertItemsEqual(actual, expected, msg=None)
+
+ Test that sequence *expected* contains the same elements as *actual*,
+ regardless of their order. When they don't, an error message listing the
+ differences between the sequences will be generated.
+
+ Duplicate elements are *not* ignored when comparing *actual* and
+ *expected*. It verifies if each element has the same count in both
+ sequences. It is the equivalent of ``assertEqual(sorted(expected),
+ sorted(actual))`` but it works with sequences of unhashable objects as
+ well.
+
+ If specified, *msg* will be used as the error message on failure.
+
+ .. versionadded:: 3.2
.. method:: assertSetEqual(set1, set2, msg=None)
Fails if either of *set1* or *set2* does not have a :meth:`set.difference`
method.
- If specified *msg* will be used as the error message on failure.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
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.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
superset of those in *expected*. If not, an error message listing
the missing keys and mismatched values is generated.
- If specified *msg* will be used as the error message on failure.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
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.
+ If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
be raised. If the sequences are different an error message is
constructed that shows the difference between the two.
- If specified *msg* will be used as the error message on failure.
+ If specified, *msg* will be used as the error message on failure.
This method is used to implement :meth:`assertListEqual` and
:meth:`assertTupleEqual`.
:class:`TestLoader` objects have the following methods:
-
+a
.. method:: loadTestsFromTestCase(testCaseClass)
Return a suite of all tests cases contained in the :class:`TestCase`\ -derived