fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing
when tests raised SystemExit. --HG-- branch : systemexit
This commit is contained in:
parent
6591d7a209
commit
e04273df57
|
@ -16,6 +16,10 @@
|
||||||
- Support building wheels by using environment markers for the
|
- Support building wheels by using environment markers for the
|
||||||
requirements. Thanks Ionel Maries Cristian.
|
requirements. Thanks Ionel Maries Cristian.
|
||||||
|
|
||||||
|
- fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing
|
||||||
|
when tests raised SystemExit. Thanks Holger Krekel.
|
||||||
|
|
||||||
|
|
||||||
2.7.0 (compared to 2.6.4)
|
2.7.0 (compared to 2.6.4)
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ class CallOutcome:
|
||||||
def __init__(self, func):
|
def __init__(self, func):
|
||||||
try:
|
try:
|
||||||
self.result = func()
|
self.result = func()
|
||||||
except Exception:
|
except BaseException:
|
||||||
self.excinfo = sys.exc_info()
|
self.excinfo = sys.exc_info()
|
||||||
|
|
||||||
def force_result(self, result):
|
def force_result(self, result):
|
||||||
|
|
|
@ -607,6 +607,21 @@ class TestMultiCall:
|
||||||
assert "m1" in str(ex.value)
|
assert "m1" in str(ex.value)
|
||||||
assert "test_core.py:" in str(ex.value)
|
assert "test_core.py:" in str(ex.value)
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("exc", [ValueError, SystemExit])
|
||||||
|
def test_hookwrapper_exception(self, exc):
|
||||||
|
l = []
|
||||||
|
def m1():
|
||||||
|
l.append("m1 init")
|
||||||
|
yield None
|
||||||
|
l.append("m1 finish")
|
||||||
|
m1.hookwrapper = True
|
||||||
|
|
||||||
|
def m2():
|
||||||
|
raise exc
|
||||||
|
with pytest.raises(exc):
|
||||||
|
MultiCall([m2, m1], {}).execute()
|
||||||
|
assert l == ["m1 init", "m1 finish"]
|
||||||
|
|
||||||
|
|
||||||
class TestHookRelay:
|
class TestHookRelay:
|
||||||
def test_happypath(self):
|
def test_happypath(self):
|
||||||
|
|
Loading…
Reference in New Issue