Fix typo and add suggestion from review

This commit is contained in:
Bruno Oliveira 2017-06-21 09:06:52 -03:00
parent afe847ecdc
commit f2ba8d70b9
1 changed files with 45 additions and 43 deletions

View File

@ -321,7 +321,8 @@ Here's the ``smtp`` fixture changed to use ``addfinalizer`` for cleanup:
request.addfinalizer(fin) request.addfinalizer(fin)
return smtp # provide the fixture value return smtp # provide the fixture value
Both ``yield`` and ``addfinalizer`` methods work similar by calling their code after the test
Both ``yield`` and ``addfinalizer`` methods work similarly by calling their code after the test
ends, but ``addfinalizer`` has two key differences over ``yield``: ends, but ``addfinalizer`` has two key differences over ``yield``:
1. It is possible to register multiple finalizer functions. 1. It is possible to register multiple finalizer functions.
@ -340,7 +341,8 @@ ends, but ``addfinalizer`` has two key differences over ``yield``:
return r return r
In the example above, if ``"C28"`` fails with an exception, ``"C1"`` and ``"C3"`` will still In the example above, if ``"C28"`` fails with an exception, ``"C1"`` and ``"C3"`` will still
be properly closed. be properly closed. Of course, if an exception happens before the finalize function is
registered then it will not be executed.
.. _`request-context`: .. _`request-context`: