write a test for the plugin

# content of conftest.py

pytest_plugins = ["pytester"]

invoke pytest with -p pytester

customize exception information

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]

https://github.com/pytest-dev/pytest/issues/7942