From 10b0b813467cda7354953ad63a19f6b625819a80 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 10 Jun 2018 11:47:58 -0300 Subject: [PATCH] Revert change of Callinfo.result default value As discussed in #3560, this should not go to master because this breaks the API. Reverts commits: 1a7dcd73cf38f07ccaa4bd19c476750a1c678cbc 198e993969ddf9ecb137150760565fccc773f11c --- changelog/3554.bugfix | 1 - src/_pytest/runner.py | 1 - testing/test_runner.py | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 changelog/3554.bugfix diff --git a/changelog/3554.bugfix b/changelog/3554.bugfix deleted file mode 100644 index 4a10d71ee..000000000 --- a/changelog/3554.bugfix +++ /dev/null @@ -1 +0,0 @@ -Allow ``CallInfo`` to have an unfinished state represented by having a ``None`` value in the ``result`` attribute. 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)