Skip to content

Commit

Permalink
docs: Fix statement about setUpAsync() and tearDownAsync() (#6313)
Browse files Browse the repository at this point in the history
Since #4732, it's wrong to says that
`setUpAsync()` and `tearDownAsync()` do nothing and can be overridden without
calling `super.setUpAsync()` and `super.tearDownAsync()`.
  • Loading branch information
H--o-l authored Nov 16, 2021
1 parent 11f35e6 commit d149eff
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,18 +369,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 d149eff

Please sign in to comment.