Fix #1210 display msg for early calls to exit

This commit is contained in:
Tom Viner
2016-07-24 14:13:43 +02:00
parent 655df7f839
commit 42adaf5a61
4 changed files with 24 additions and 1 deletions

View File

@@ -457,6 +457,18 @@ def test_pytest_fail():
s = excinfo.exconly(tryshort=True)
assert s.startswith("Failed")
def test_pytest_exit_msg(testdir):
testdir.makeconftest("""
import pytest
def pytest_configure(config):
pytest.exit('oh noes')
""")
result = testdir.runpytest()
result.stderr.fnmatch_lines([
"Exit: oh noes",
])
def test_pytest_fail_notrace(testdir):
testdir.makepyfile("""
import pytest