Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pytest-dev/pytest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f35acdf
Choose a base ref
...
head repository: pytest-dev/pytest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5dc2eed
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Apr 9, 2020

  1. Call cleanup functions if explicit teardown is needed

    Not calling cleanup functions after a test fails may affect other tests
    down the row.
    
    This issue was introduced in 04f27d4.
    
    When a test fails, a `GetOutOf_testPartExecutor` exception is raised to
    make `unittest` halt `testPartExecutor`:
    
    https://github.com/pytest-dev/pytest/blob/413ca8a4d097ed1a98b2d1012ca7df17aa6837b1/src/_pytest/unittest.py#L206-L228
    
    That prevents `teardown` **and** cleanup functions from being called.
    That's why `self._needs_explicit_tearDown` is set to `True` to then
    explicitly call `teardown` later on:
    
    https://github.com/pytest-dev/pytest/blob/413ca8a4d097ed1a98b2d1012ca7df17aa6837b1/src/_pytest/unittest.py#L122-L126
    
    But no cleanup functions are called. Hence this PR.
    scorphus committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    5dc2eed View commit details
    Browse the repository at this point in the history
Loading