Revert change of Callinfo.result default value

As discussed in #3560, this should not go to master because this breaks
the API.

Reverts commits:

1a7dcd73cf
198e993969
This commit is contained in:
Bruno Oliveira 2018-06-10 11:47:58 -03:00
parent 80f8a3ad7c
commit 10b0b81346
3 changed files with 1 additions and 3 deletions

View File

@ -1 +0,0 @@
Allow ``CallInfo`` to have an unfinished state represented by having a ``None`` value in the ``result`` attribute.

View File

@ -194,7 +194,6 @@ class CallInfo(object):
#: "teardown", "memocollect" #: "teardown", "memocollect"
self.when = when self.when = when
self.start = time() self.start = time()
self.result = None
try: try:
self.result = func() self.result = func()
except KeyboardInterrupt: except KeyboardInterrupt:

View File

@ -473,7 +473,7 @@ def test_callinfo():
assert "result" in repr(ci) assert "result" in repr(ci)
ci = runner.CallInfo(lambda: 0 / 0, "123") ci = runner.CallInfo(lambda: 0 / 0, "123")
assert ci.when == "123" assert ci.when == "123"
assert ci.result is None assert not hasattr(ci, "result")
assert ci.excinfo assert ci.excinfo
assert "exc" in repr(ci) assert "exc" in repr(ci)