Making LogRecord class derivable#77
Conversation
Codecov Report
@@ Coverage Diff @@
## main #77 +/- ##
==========================================
+ Coverage 88.47% 88.86% +0.38%
==========================================
Files 11 11
Lines 2056 2056
==========================================
+ Hits 1819 1827 +8
+ Misses 237 229 -8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
tonybaloney
left a comment
There was a problem hiding this comment.
Please add the following scenarios to the test:
- run the constructor
- check attribute access
- check method execution
Copy the assertions in test_no_args() that'll cover those scenarios
|
Added! I do want to flag that there is a slight inconsistency between how the logging.LogRecord constructor arguments are handled versus the picologging.LogRecord constructor. For logging.LogRecord, Python already knows exactly which positional arguments are missing. For picologging.LogRecord, it only seems to know one argument at a time. I don't know 1) if it matters, or 2) how to change them to match- it's not obvious to me why the experience is different. |
It doesn't really matter, it still raises the correct exception type |
I am currently checking for differences between CPython logging module and picologging by running the CPython logging tests, and this was the first issue it found: logging.LogRecord can be a base class, picologging.LogRecord cannot. I fixed that by adding the relevant flag to tp_flags and adding a test.