Index: Doc/library/unittest.rst =================================================================== --- Doc/library/unittest.rst (révision 88326) +++ Doc/library/unittest.rst (copie de travail) @@ -176,30 +176,6 @@ documentation explores the full feature set from first principles. -.. _unittest-command-line-interface: - -Command-Line Interface ----------------------- - -The unittest module can be used from the command line to run tests from -modules, classes or even individual test methods:: - - python -m unittest test_module1 test_module2 - python -m unittest test_module.TestClass - python -m unittest test_module.TestClass.test_method - -You can pass in a list with any combination of module names, and fully -qualified class or method names. - -You can run tests with more detail (higher verbosity) by passing in the -v flag:: - - python -m unittest -v test_module - -For a list of all the command-line options:: - - python -m unittest -h - - .. _organizing-tests: Organizing test code @@ -1008,36 +984,6 @@ .. versionadded:: 3.1 - .. method:: addCleanup(function, *args, **kwargs) - - Add a function to be called after :meth:`tearDown` to cleanup resources - used during the test. Functions will be called in reverse order to the - order they are added (LIFO). They are called with any arguments and - keyword arguments passed into :meth:`addCleanup` when they are - added. - - If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, - then any cleanup functions added will still be called. - - .. versionadded:: 3.2 - - - .. method:: doCleanups() - - This method is called unconditionally after :meth:`tearDown`, or - after :meth:`setUp` if :meth:`setUp` raises an exception. - - It is responsible for calling all the cleanup functions added by - :meth:`addCleanup`. If you need cleanup functions to be called - *prior* to :meth:`tearDown` then you can call :meth:`doCleanups` - yourself. - - :meth:`doCleanups` pops methods off the stack of cleanup - functions one at a time, so it can be called at any time. - - .. versionadded:: 3.2 - - .. class:: FunctionTestCase(testFunc, setUp=None, tearDown=None, description=None) This class implements the portion of the :class:`TestCase` interface which @@ -1106,19 +1052,6 @@ individual tests and sub-suites. - .. method:: __iter__() - - Tests grouped by a :class:`TestSuite` are always accessed by iteration. - Subclasses can lazily provide tests by overriding :meth:`__iter__`. Note - that this method maybe called several times on a single suite - (for example when counting tests or comparing for equality) - so the tests returned must be the same for repeated iterations. - - .. versionchanged:: 3.2 - In earlier versions the :class:`TestSuite` accessed tests directly rather - than through iteration, so overriding :meth:`__iter__` wasn't sufficient - for providing tests. - In the typical usage of a :class:`TestSuite` object, the :meth:`run` method is invoked by a :class:`TestRunner` rather than by the end-user test harness. @@ -1324,20 +1257,6 @@ The default implementation does nothing. - .. method:: startTestRun(test) - - Called once before any tests are executed. - - .. versionadded:: 3.2 - - - .. method:: stopTestRun(test) - - Called once before any tests are executed. - - .. versionadded:: 3.2 - - .. method:: addError(test, err) Called when the test case *test* raises an unexpected exception *err* is a