1 new commit in pytest: https://bitbucket.org/pytest-dev/pytest/commits/e966701003e4/ Changeset: e966701003e4 User: flub Date: 2015-04-17 10:10:47+00:00 Summary: Merge pull request #274 from pytest-2.7
fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing Affected #: 3 files diff -r 7d32b89da36e8714554fae12483a1fbb2bf7c1c7 -r e966701003e436b00e8e517d08d16cb2b1ee9d1c CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,10 @@ - Support building wheels by using environment markers for the 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) ----------------------------- diff -r 7d32b89da36e8714554fae12483a1fbb2bf7c1c7 -r e966701003e436b00e8e517d08d16cb2b1ee9d1c _pytest/core.py --- a/_pytest/core.py +++ b/_pytest/core.py @@ -121,7 +121,7 @@ def __init__(self, func): try: self.result = func() - except Exception: + except BaseException: self.excinfo = sys.exc_info() def force_result(self, result): diff -r 7d32b89da36e8714554fae12483a1fbb2bf7c1c7 -r e966701003e436b00e8e517d08d16cb2b1ee9d1c testing/test_core.py --- a/testing/test_core.py +++ b/testing/test_core.py @@ -607,6 +607,21 @@ assert "m1" 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: def test_happypath(self): Repository URL: https://bitbucket.org/pytest-dev/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit