diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index b8ba70fa0..ef1a0e694 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -194,7 +194,6 @@ class CallInfo(object): #: "teardown", "memocollect" self.when = when self.start = time() - self.result = None try: self.result = func() except KeyboardInterrupt: diff --git a/testing/test_runner.py b/testing/test_runner.py index 9085dbe9a..26493de6e 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -473,7 +473,7 @@ def test_callinfo(): assert "result" in repr(ci) ci = runner.CallInfo(lambda: 0 / 0, "123") assert ci.when == "123" - assert ci.result is None + assert not hasattr(ci, "result") assert ci.excinfo assert "exc" in repr(ci)