#299 - polishing
This commit is contained in:
parent
d2dc797779
commit
9e3cd03721
|
@ -198,7 +198,8 @@ def pytest_runtest_makereport(item, call):
|
||||||
if call.when == "call":
|
if call.when == "call":
|
||||||
longrepr = item.repr_failure(excinfo)
|
longrepr = item.repr_failure(excinfo)
|
||||||
else: # exception in setup or teardown
|
else: # exception in setup or teardown
|
||||||
longrepr = item._repr_failure_py(excinfo,style=item.config.option.tbstyle)
|
longrepr = item._repr_failure_py(excinfo,
|
||||||
|
style=item.config.option.tbstyle)
|
||||||
return TestReport(item.nodeid, item.location,
|
return TestReport(item.nodeid, item.location,
|
||||||
keywords, outcome, longrepr, when,
|
keywords, outcome, longrepr, when,
|
||||||
duration=duration)
|
duration=duration)
|
||||||
|
|
|
@ -665,3 +665,19 @@ def test_fdopen_kept_alive_issue124(testdir):
|
||||||
result.stdout.fnmatch_lines([
|
result.stdout.fnmatch_lines([
|
||||||
"*2 passed*"
|
"*2 passed*"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
def test_tbstyle_native_setup_error(testdir):
|
||||||
|
p = testdir.makepyfile("""
|
||||||
|
import pytest
|
||||||
|
@pytest.fixture
|
||||||
|
def setup_error_fixture():
|
||||||
|
raise Exception("error in exception")
|
||||||
|
|
||||||
|
def test_error_fixture(setup_error_fixture):
|
||||||
|
pass
|
||||||
|
""")
|
||||||
|
result = testdir.runpytest("--tb=native")
|
||||||
|
result.stdout.fnmatch_lines([
|
||||||
|
'*File *test_tbstyle_native_setup_error.py", line *, in setup_error_fixture*'
|
||||||
|
])
|
||||||
|
|
Loading…
Reference in New Issue