# content of conftest.py
pytest_plugins = ["pytester"]
invoke pytest with -p pytester
Python pytest pytest_exception_interact customize exception information from VCR.py exception
@pytest.hookimpl()
def pytest_exception_interact(node, call, report):
    if isinstance(call.excinfo.value, AssertionError):
        entry = report.longrepr.reprtraceback.reprentries[-1]
        entry.style = "short"
        entry.lines = entry.lines[-3:]
        report.longrepr.reprtraceback.reprentries = [entry]