Skip to content

Commit 127a372

Browse files
authored
Merge pull request #12259 from bluetech/plain-raise
runner: avoid adding uninteresting entry to tracebacks
2 parents 2a809e6 + fc5c960 commit 127a372

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def pytest_runtest_call(item: Item) -> None:
180180
assert e.__traceback__ is not None
181181
# Skip *this* frame
182182
sys.last_traceback = e.__traceback__.tb_next
183-
raise e
183+
raise
184184

185185

186186
def pytest_runtest_teardown(item: Item, nextitem: Optional[Item]) -> None:
@@ -512,7 +512,7 @@ def setup(self, item: Item) -> None:
512512
col.setup()
513513
except TEST_OUTCOME as exc:
514514
self.stack[col] = (self.stack[col][0], exc)
515-
raise exc
515+
raise
516516

517517
def addfinalizer(self, finalizer: Callable[[], object], node: Node) -> None:
518518
"""Attach a finalizer to the given node.

0 commit comments

Comments
 (0)