opinion: don't bother typing tests (intermediate) anthony explains
Вставка
- Опубліковано 12 лис 2024
- today I talk about the approach I take to gradual typing in python -- I don't bother with tests (and why)!
intro to typing / mypy: • introduction to python...
gradual typing with mypy: • gradual typing python ...
playlist: • anthony explains
==========
twitch: / anthonywritescode
dicsord: / discord
twitter: / codewithanthony
github: github.com/aso...
stream github: github.com/ant...
I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
for me types are mostly for readability, not for correctness (so no matter in tests or in actual code). You read function header and quickly understand what it does w/o reading docstrings
sure, for this I'm specifically talking about static type checking
I like to annotate tests as a way to test the annotations of the system-under-test. If some usage of the system-under-test is valid, but not annotated correctly, I want mypy to fail. Any thoughts on this?
I do those rarely but I keep them separate from my "executable tests" -- I usually call them "types tests" and really only use them when the types are an important part of the public interface *or* they're sufficiently complicated
@@anthonywritescode I would love a video on "type tests"! I've thought about this vaguely but I couldn't find precedent for it.
Thank you Anthony, very cool!
I want to purchase keyboard you use. Can you share product model or amazon url?
yep! I do a review of the keyboard here (and the amazon link is in the description): ua-cam.com/video/DZgCUWf9DZM/v-deo.html
I thought this was going to be "don't bother typing out test cases", as in writing tests :p
I write all my tests in mspaint bay beeeeee