Skip to content

Commit

Permalink
docs: Fix statement about setUpAsync() and tearDownAsync() (#6313) (
Browse files Browse the repository at this point in the history
#6317)

Since #4732, it's wrong to says that
`setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without
calling `super.setUpAsync()` and `super.tearDownAsync()`.

(cherry picked from commit d149eff)

Co-authored-by: Hoel IRIS <hoel.iris@gmail.com>
  • Loading branch information
patchback[bot] and H--o-l committed Nov 16, 2021
1 parent 30bdb25 commit 724a996
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/testing.rst
Expand Up @@ -322,18 +322,34 @@ functionality, the AioHTTPTestCase is provided::

.. comethod:: setUpAsync()

This async method do nothing by default and can be overridden to execute
asynchronous code during the ``setUp`` stage of the ``TestCase``.
This async method can be overridden to execute asynchronous code during
the ``setUp`` stage of the ``TestCase``::

async def setUpAsync(self):
await super().setUpAsync()
await foo()

.. versionadded:: 2.3

.. versionchanged:: 3.8

``await super().setUpAsync()`` call is required.

.. comethod:: tearDownAsync()

This async method do nothing by default and can be overridden to execute
asynchronous code during the ``tearDown`` stage of the ``TestCase``.
This async method can be overridden to execute asynchronous code during
the ``tearDown`` stage of the ``TestCase``::

async def tearDownAsync(self):
await super().tearDownAsync()
await foo()

.. versionadded:: 2.3

.. versionchanged:: 3.8

``await super().tearDownAsync()`` call is required.

.. method:: setUp()

Standard test initialization method.
Expand Down

0 comments on commit 724a996

Please sign in to comment.