-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
I'd expect the assert
in my conftest.py
to pass, but it doesn't:
# test_foo.py
import pytest
def test_foo(foo):
pytest.fail("Hello World", pytrace=False)
# conftest.py
import pytest
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
assert not isinstance(report.longrepr, str)
Without pytrace=False
, it's a py._code.code.ReprExceptionInfo
instance, which means I can use report.longrepr.addsection
to add additional information.
With pytrace=False
, it's a str
, and even appending something to that string won't get pytest to show the output I'd like to show.
thomasleveil and nicoddemus
Metadata
Metadata
Assignees
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstype: bugproblem that needs to be addressedproblem that needs to be addressed