diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6d754d929..2dc03d693 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,7 +14,7 @@ level an error will be raised during collection. Thanks `@omarkohl`_ for the complete PR (`#1519`_). -* Fix (`1516`_): ConftestImportFailure now shows the traceback +* Fix (`#1516`_): ConftestImportFailure now shows the traceback **Incompatible changes** @@ -30,6 +30,7 @@ * removed support code for python 3 < 3.3 addressing (`#1627`_) .. _#607: https://github.com/pytest-dev/pytest/issues/607 +.. _#1516: https://github.com/pytest-dev/pytest/issues/1516 .. _#1519: https://github.com/pytest-dev/pytest/pull/1519 .. _#1664: https://github.com/pytest-dev/pytest/pull/1664 .. _#1627: https://github.com/pytest-dev/pytest/pull/1627 diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 6f5e77f6d..54a7d4009 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -407,3 +407,16 @@ def test_issue1073_conftest_special_objects(testdir): """) res = testdir.runpytest() assert res.ret == 0 + + +def test_conftest_exception_handling(testdir): + testdir.makeconftest(''' + raise ValueError() + ''') + testdir.makepyfile(""" + def test_some(): + pass + """) + res = testdir.runpytest() + assert res.ret == 4 + assert 'raise ValueError()' in [line.strip() for line in res.errlines]