Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do i need to declare none for mypy pytest functions?

Tags:

pytest

mypy

So i basically just read in the documentation that

If a function does not explicitly return a value, give it a return type of None. Using a None result in a statically typed context results in a type check error

Does that also include pytest functions? Do i have to annotate every pytest func with None?

like image 446
supersick Avatar asked Oct 26 '25 08:10

supersick


1 Answers

Yes, or run mypy with --check-untyped-defs, though of course that may hide other functions you've forgotten to annotate

like image 94
joel Avatar answered Oct 29 '25 08:10

joel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!