Avoid leaving a reference to the last item on CaptureManager

This commit is contained in:
Bruno Oliveira 2018-08-18 11:08:03 -03:00
parent eb2d074530
commit 9f7345d663
1 changed files with 3 additions and 0 deletions

View File

@ -176,6 +176,7 @@ class CaptureManager(object):
# be activated during pytest_runtest_call
yield
self.suspend_capture_item(item, "setup")
self._current_item = None
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_call(self, item):
@ -186,6 +187,7 @@ class CaptureManager(object):
self.activate_fixture(item)
yield
self.suspend_capture_item(item, "call")
self._current_item = None
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_teardown(self, item):
@ -194,6 +196,7 @@ class CaptureManager(object):
self.activate_fixture(item)
yield
self.suspend_capture_item(item, "teardown")
self._current_item = None
@pytest.hookimpl(tryfirst=True)
def pytest_keyboard_interrupt(self, excinfo):