Closed lunkwill42 closed 4 months ago
3 files 3 suites 51s :stopwatch: 318 tests 318 :heavy_check_mark: 0 :zzz: 0 :x: 954 runs 952 :heavy_check_mark: 2 :zzz: 0 :x:
Results for commit ed66ca32.
:recycle: This comment has been updated with latest results.
This apparently needs some more work, as the new Protocol implementation works just fine on Python 3.11 (which I use), but fails on Python 3.9 and 3.10. Something to do with the init method of TrapObserver
and its subclasses.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.98%. Comparing base (
5805c67
) to head (ed66ca3
). Report is 2 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
Now that we're on the brink of implementing more actual trap handlers, it's time to slightly rethink the original alpha implementation of the trap observer protocol.
This reworks the protocol from being simple functions to being slightly more involved classes (which can inherit directly from the protocol to remain somewhat simple). I realized that many of the observers will need access to the running
ZinoState
as well as the running event loop (which handlers already had an argument for). It makes no sense to keep adding arguments to trap handler functions for everything not all of them need. Instead, these more permanent values can be fed to the trap observers inherited constructor, and the handler function itself needs only concern itself with the incoming trap message argument.This makes for even stronger separation of concerns.
This PR moves the list of ignored traps to a separate
TrapObserver
subclass, leaving it cleanly out of theTrapReceiver
implementation itself, and serving as a sort of template of how the remaining observers can be implemented.