Skip to content

Conversation

@VmirGerts
Copy link

@VmirGerts VmirGerts commented Nov 14, 2025

TODO

see: #87

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.22%. Comparing base (d88606a) to head (26bfc36).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
- Coverage   96.96%   96.22%   -0.75%     
==========================================
  Files           9        9              
  Lines         758      768      +10     
  Branches       53       47       -6     
==========================================
+ Hits          735      739       +4     
- Misses         18       25       +7     
+ Partials        5        4       -1     
Flag Coverage Δ
py310 (macos/arm64) 78.98% <93.54%> (-0.26%) ⬇️
py310 (ubuntu/x64) 78.98% <93.54%> (-0.26%) ⬇️
py310 (windows/x64) 78.98% <93.54%> (-0.26%) ⬇️
py311 (macos/arm64) 95.95% <100.00%> (-0.75%) ⬇️
py311 (ubuntu/x64) 95.95% <100.00%> (-0.75%) ⬇️
py311 (windows/x64) 95.95% <100.00%> (-0.75%) ⬇️
py312 (macos/arm64) 95.95% <100.00%> (-0.75%) ⬇️
py312 (ubuntu/x64) 95.95% <100.00%> (-0.75%) ⬇️
py312 (windows/x64) 95.95% <100.00%> (-0.75%) ⬇️
py313 (macos/arm64) 95.95% <100.00%> (-0.75%) ⬇️
py313 (ubuntu/x64) 95.95% <100.00%> (-0.75%) ⬇️
py313 (windows/x64) 95.95% <100.00%> (-0.75%) ⬇️
py314 (macos/arm64) 95.95% <100.00%> (-0.22%) ⬇️
py314 (ubuntu/x64) 95.95% <100.00%> (-0.22%) ⬇️
py314 (windows/x64) 95.95% <100.00%> (-0.22%) ⬇️
py39 (macos/arm64) 78.64% <93.54%> (-0.25%) ⬇️
py39 (ubuntu/x64) 78.64% <93.54%> (-0.25%) ⬇️
py39 (windows/x64) 78.64% <93.54%> (-0.25%) ⬇️
pypy310 (macos/arm64) ?
pypy310 (ubuntu/x64) 77.15% <93.54%> (+0.30%) ⬆️
pypy310 (windows/x64) 77.15% <93.54%> (+0.30%) ⬆️
pypy311 (macos/arm64) 94.12% <100.00%> (-0.19%) ⬇️
pypy311 (ubuntu/x64) 94.12% <100.00%> (-0.19%) ⬇️
pypy311 (windows/x64) 94.12% <100.00%> (-0.19%) ⬇️
pypy39 (macos/arm64) 76.82% <93.54%> (+0.30%) ⬆️
pypy39 (ubuntu/x64) 76.82% <93.54%> (+0.30%) ⬆️
pypy39 (windows/x64) 76.82% <93.54%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

func = type(obj)
# Detect busted objects: they have a custom __init__ but no __reduce__.
# This also means the resulting exceptions may be a bit "dulled" down - the args from __reduce__ are discarded.
if func.__reduce__ in builtin_reducers and func.__init__ not in builtin_inits:
Copy link
Author

@VmirGerts VmirGerts Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To elaborate a bit on the change:

Having the if func.__reduce__ in builtin_reducers and func.__init__ not in builtin_inits check makes several built-in exceptions fall in the first if-branch, e.g. SystemExit, NameError, StopIteration.

To not process each of them separately, _get_public_class_attributes is used to get all public class attributes (also of the base classes).

This way, having the second branch looks not really necessary.

Note: one could check if an exception is a built-in exception and then just rely on the "native" reduce function. But this also doesn't work always. For example NameError.__reduce__ doesn't preserve the "name" class-attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant