https://github.com/agronholm/anyio/blob/9eb4671547b01f5e3ba0e0ca602b6aceec15af86/src/anyio/_backends/_asyncio.py#L598

On Sat, 29 May 2021, 20:24 André Roberge, <andre.roberge@gmail.com> wrote:


On Sat, May 29, 2021 at 3:25 PM Thomas Grainger <tagrain@gmail.com> wrote:

Thanks for the reminder.  Pytest takes care of traceback formatting for users.  Individual projects can of course do that. But I want to do the reverse: I want to limit what users of my projects will see in a traceback, without having them specify something in their code.

What I am interested in is having a project-agnostic standardised Python way to specify what to show to an end-user when an exception is raised.

Eg anyio sets __tracebackhide__ = __traceback_hide__ = True to remove internal frames from user Tracebacks
 
Do you have a specific link to this?  I have looked in the documentation as well as in a few modules (_core/_exceptions.py in particular) without seeing any reference to this. I am not interested in custom formatting for testing, which is something comparatively easy to do.