summaryrefslogtreecommitdiff
path: root/_pytest
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2018-04-12 07:53:34 -0300
committerGitHub <noreply@github.com>2018-04-12 07:53:34 -0300
commit015626ce69bfda6e12aad4e3c4454cf35ff5ac95 (patch)
treecedbf193b9bac8f62129fcf9c253a4c18537e150 /_pytest
parentf9a908abb80747e546a1fa87ce30d379257f38ce (diff)
parent6e8e3c967ada43ba47d0b85842607a5f975c5c81 (diff)
downloadpytest-015626ce69bfda6e12aad4e3c4454cf35ff5ac95.tar.gz
Merge pull request #3384 from nicoddemus/leak-frame
Reset reference to failed test frame before each test executes
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/runner.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/_pytest/runner.py b/_pytest/runner.py
index 6792387db..f62d34df2 100644
--- a/_pytest/runner.py
+++ b/_pytest/runner.py
@@ -105,6 +105,7 @@ def pytest_runtest_setup(item):
def pytest_runtest_call(item):
_update_current_test_var(item, 'call')
+ sys.last_type, sys.last_value, sys.last_traceback = (None, None, None)
try:
item.runtest()
except Exception:
@@ -114,7 +115,7 @@ def pytest_runtest_call(item):
sys.last_type = type
sys.last_value = value
sys.last_traceback = tb
- del tb # Get rid of it in this namespace
+ del type, value, tb # Get rid of these in this frame
raise