Commit 6ac4240b authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue #18566: Clarify unittest setUp, tearDown doc. Patch by Nitika Agarwal.

parent 45278a89
...@@ -674,9 +674,9 @@ Test cases ...@@ -674,9 +674,9 @@ Test cases
.. method:: setUp() .. method:: setUp()
Method called to prepare the test fixture. This is called immediately Method called to prepare the test fixture. This is called immediately
before calling the test method; any exception raised by this method will before calling the test method; other than :exc:`AssertionError` or :exc:`SkipTest`,
be considered an error rather than a test failure. The default any exception raised by this method will be considered an error rather than
implementation does nothing. a test failure. The default implementation does nothing.
.. method:: tearDown() .. method:: tearDown()
...@@ -684,10 +684,10 @@ Test cases ...@@ -684,10 +684,10 @@ Test cases
Method called immediately after the test method has been called and the Method called immediately after the test method has been called and the
result recorded. This is called even if the test method raised an result recorded. This is called even if the test method raised an
exception, so the implementation in subclasses may need to be particularly exception, so the implementation in subclasses may need to be particularly
careful about checking internal state. Any exception raised by this careful about checking internal state. Any exception, other than :exc:`AssertionError`
method will be considered an error rather than a test failure. This or :exc:`SkipTest`, raised by this method will be considered an error rather than a
method will only be called if the :meth:`setUp` succeeds, regardless of test failure. This method will only be called if the :meth:`setUp` succeeds,
the outcome of the test method. The default implementation does nothing. regardless of the outcome of the test method. The default implementation does nothing.
.. method:: setUpClass() .. method:: setUpClass()
......
...@@ -18,6 +18,7 @@ David Abrahams ...@@ -18,6 +18,7 @@ David Abrahams
Marc Abramowitz Marc Abramowitz
Ron Adam Ron Adam
Ali Afshar Ali Afshar
Nitika Agarwal
Jim Ahlstrom Jim Ahlstrom
Farhan Ahmad Farhan Ahmad
Matthew Ahrens Matthew Ahrens
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment