pytest-dev / pluggy

A minimalist production ready plugin system
https://pluggy.readthedocs.io/en/latest/
MIT License
1.24k stars 121 forks source link

[WIP] Issue 424/add saferepr #460

Open anusha-shekhar opened 9 months ago

anusha-shekhar commented 9 months ago

Description

An error was thrown after enabling tracing if one of the local objects lacked a specific outdated Scikit-Learn object. The issue asked to include error handling when outputting tracing messages for invalid string representations in order to increase the robustness of Pluggy’s error handling mechanism.

Solution

The saferepr module was implemented and adapted to Pluggy, as done in the Pytest repo. Saferepr includes a generous try...except clause along with additional error handling. This ensures that errors do not bubble up.

Steps to test

Link to issue

https://github.com/pytest-dev/pluggy/issues/424

anusha-shekhar commented 9 months ago

Hi! It seems that some of the code coverage pipeline is inaccurate. It is counting empty lines as requiring test coverage (please see screenshot provided)

Screenshot 2023-12-13 at 11 36 23 PM