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
Provide an invalid repr object
It should safely handle such a string representation
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)
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