test: add type hinting to test_lib#1012
Conversation
* Stop testing debug level logs. * Ignore the type checking when we are deliberately checking for bad type handling. * Pass a dummy spec rather than None, to avoid type complaints. * Work around an optional argument.
benhoyt
left a comment
There was a problem hiding this comment.
Very good work, and thanks for the removal of logassert as discussed. No need for this to be a draft PR I think.
|
Looks like there's one failing test on Python 3.8, presumably due to |
|
@benhoyt this failed in CI because unittest.TestCase.assertNoLogs is new in 3.10. Would you just get rid of the check that there's no warning logged, or do a temporary but ugly Edit: oops, Github hadn't refreshed the page, so I didn't notice you already said that. But still, the same question: do you have a preference for how it's avoided? I would tend towards just not doing this check. |
I changed it to draft when I saw it failed in CI, to hopefully (but not successfully) avoid you bothering with it before I fixed the issue. |
Ah, don't worry about that.
I think if it's worth doing the test it's worth doing it on Python 3.8 too (a version we need to support). So let's change it to use |
Extends the type hinting for tests:
Partially addresses #1007.