py.builtin._reraise -> six.reraise

This commit is contained in:
Anthony Sottile 2018-08-22 19:28:42 -07:00
parent dccac69d82
commit 7099ea9bb0
3 changed files with 7 additions and 7 deletions

View File

@ -858,7 +858,7 @@ class FixtureDef(object):
if exceptions:
e = exceptions[0]
del exceptions # ensure we don't keep all frames alive because of the traceback
py.builtin._reraise(*e)
six.reraise(*e)
finally:
hook = self._fixturemanager.session.gethookproxy(request.node.fspath)
@ -885,7 +885,7 @@ class FixtureDef(object):
result, cache_key, err = cached_result
if my_cache_key == cache_key:
if err is not None:
py.builtin._reraise(*err)
six.reraise(*err)
else:
return result
# we have a previous but differently parametrized fixture instance

View File

@ -6,7 +6,7 @@ import os
import sys
from time import time
import py
import six
from _pytest._code.code import ExceptionInfo
from _pytest.outcomes import skip, Skipped, TEST_OUTCOME
@ -317,7 +317,7 @@ class SetupState(object):
if exc is None:
exc = sys.exc_info()
if exc:
py.builtin._reraise(*exc)
six.reraise(*exc)
def _teardown_with_finalization(self, colitem):
self._callfinalizers(colitem)
@ -352,7 +352,7 @@ class SetupState(object):
if exc is None:
exc = sys.exc_info()
if exc:
py.builtin._reraise(*exc)
six.reraise(*exc)
def prepare(self, colitem):
""" setup objects along the collector chain to the test-method
@ -363,7 +363,7 @@ class SetupState(object):
# check if the last collection node has raised an error
for col in self.stack:
if hasattr(col, "_prepare_exc"):
py.builtin._reraise(*col._prepare_exc)
six.reraise(*col._prepare_exc)
for col in needed_collectors[len(self.stack) :]:
self.stack.append(col)
try:

View File

@ -252,7 +252,7 @@ class TestTraceback_f_g_h(object):
import sys
exc, val, tb = sys.exc_info()
py.builtin._reraise(exc, val, tb)
six.reraise(exc, val, tb)
def f(n):
try: