Skip to content

Commit

Permalink
Merge pull request #2859 from OwenTuz/issue-2692-document-setup-teard…
Browse files Browse the repository at this point in the history
…own-mismatch-in-unittest-integration

2692.docs document setup/teardown behaviour when using unittest-based su…
  • Loading branch information
nicoddemus authored Oct 23, 2017
2 parents 531e0dc + 3cdbb18 commit b61cbc4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/en/unittest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,13 @@ was executed ahead of the ``test_method``.
overwrite ``unittest.TestCase`` ``__call__`` or ``run``, they need to
to overwrite ``debug`` in the same way (this is also true for standard
unittest).

.. note::

Due to architectural differences between the two frameworks, setup and
teardown for ``unittest``-based tests is performed during the ``call`` phase
of testing instead of in ``pytest``'s standard ``setup`` and ``teardown``

This comment has been minimized.

Copy link
@rgivens56

rgivens56 Oct 24, 2017

Due to architectural differences between the two frameworks, setup and teardown for unittest based tests is performed during the call phase of testing, instead of in the pytest standard.

This comment has been minimized.

Copy link
@rgivens56

rgivens56 Oct 24, 2017

Added punctuation to help the sentence to read clearer.

stages. This can be important to understand in some situations, particularly
when reasoning about errors. For example, if a ``unittest``-based suite
exhibits errors during setup, ``pytest`` will report no errors during its
``setup`` phase and will instead raise the error during ``call``.

1 comment on commit b61cbc4

@rgivens56
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope this helps.

Please sign in to comment.