Skip to content

Commit 10b0b81

Browse files
committed
Revert change of Callinfo.result default value
As discussed in #3560, this should not go to master because this breaks the API. Reverts commits: 1a7dcd7 198e993
1 parent 80f8a3a commit 10b0b81

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

changelog/3554.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/_pytest/runner.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ def __init__(self, func, when, treat_keyboard_interrupt_as_exception=False):
194194
#: "teardown", "memocollect"
195195
self.when = when
196196
self.start = time()
197-
self.result = None
198197
try:
199198
self.result = func()
200199
except KeyboardInterrupt:

testing/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def test_callinfo():
473473
assert "result" in repr(ci)
474474
ci = runner.CallInfo(lambda: 0 / 0, "123")
475475
assert ci.when == "123"
476-
assert ci.result is None
476+
assert not hasattr(ci, "result")
477477
assert ci.excinfo
478478
assert "exc" in repr(ci)
479479

0 commit comments

Comments
 (0)