[Python-checkins] r67878 - python/branches/py3k-issue1717/Doc/library/unittest.rst

mark.dickinson python-checkins at python.org
Sat Dec 20 18:23:35 CET 2008


Author: mark.dickinson
Date: Sat Dec 20 18:23:35 2008
New Revision: 67878
Log:
Remove references to cmp in unittest documentation.
Modified:
 python/branches/py3k-issue1717/Doc/library/unittest.rst
Modified: python/branches/py3k-issue1717/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k-issue1717/Doc/library/unittest.rst	(original)
+++ python/branches/py3k-issue1717/Doc/library/unittest.rst	Sat Dec 20 18:23:35 2008
@@ -327,8 +327,9 @@
 ``WidgetTestCase.testResize``. :class:`TestLoader` uses the ``'test'`` method
 name prefix to identify test methods automatically.
 
-Note that the order in which the various test cases will be run is determined by
-sorting the test function names with the built-in :func:`cmp` function.
+Note that the order in which the various test cases will be run is
+determined by sorting the test function names with respect to the
+built-in ordering for strings.
 
 Often it is desirable to group suites of test cases together, so as to run tests
 for the whole system at once. This is easy, since :class:`TestSuite` instances
@@ -916,9 +917,13 @@
 .. attribute:: TestLoader.sortTestMethodsUsing
 
 Function to be used to compare method names when sorting them in
- :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods. The
- default value is the built-in :func:`cmp` function; the attribute can also be
- set to :const:`None` to disable the sort.
+ :meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*`
+ methods. This should be a function that takes two arguments
+ ``self`` and ``other``, and returns ``-1`` if ``self`` precedes
+ ``other`` in the desired ordering, ``1`` if ``other`` precedes
+ ``self``, and ``0`` if ``self`` and ``other`` are equal. The
+ default ordering is the built-in ordering for strings. This
+ attribute can also be set to :const:`None` to disable the sort.
 
 
 .. attribute:: TestLoader.suiteClass


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /