mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Issue #18566: Clarify unittest setUp, tearDown doc. Patch by Nitika Agarwal.
This commit is contained in:
parent
45278a898c
commit
6ac4240b6c
@ -674,9 +674,9 @@ Test cases
|
||||
.. method:: setUp()
|
||||
|
||||
Method called to prepare the test fixture. This is called immediately
|
||||
before calling the test method; any exception raised by this method will
|
||||
be considered an error rather than a test failure. The default
|
||||
implementation does nothing.
|
||||
before calling the test method; other than :exc:`AssertionError` or :exc:`SkipTest`,
|
||||
any exception raised by this method will be considered an error rather than
|
||||
a test failure. The default implementation does nothing.
|
||||
|
||||
|
||||
.. method:: tearDown()
|
||||
@ -684,10 +684,10 @@ Test cases
|
||||
Method called immediately after the test method has been called and the
|
||||
result recorded. This is called even if the test method raised an
|
||||
exception, so the implementation in subclasses may need to be particularly
|
||||
careful about checking internal state. Any exception raised by this
|
||||
method will be considered an error rather than a test failure. This
|
||||
method will only be called if the :meth:`setUp` succeeds, regardless of
|
||||
the outcome of the test method. The default implementation does nothing.
|
||||
careful about checking internal state. Any exception, other than :exc:`AssertionError`
|
||||
or :exc:`SkipTest`, raised by this method will be considered an error rather than a
|
||||
test failure. This method will only be called if the :meth:`setUp` succeeds,
|
||||
regardless of the outcome of the test method. The default implementation does nothing.
|
||||
|
||||
|
||||
.. method:: setUpClass()
|
||||
|
Loading…
Reference in New Issue
Block a user