-
-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Right now we don't test classes with hypothesis at all.
But, I have a great idea (at least it seems to me like so) of adding a hypothesis plugin, similar to one we have in returns: https://github.com/dry-python/returns/blob/master/returns/contrib/hypothesis/laws.py
What should it do?
check_typeclass(typeclass_instance)will check that for all existing types and protocols some valid return type is produced. For example,@typeclass def some(instance) -> strmust producestrfor allinstance,protocol, and supported types and it must produceNotImplementedErrorfor types that are not supported- Looks like
check_typeclassmust haveallow_instances,allow_protocols,allow_unknownkwboolarguments to configure what types we actually need in a resulting strategy
It would be a nice companion to our mypy check.
@Zac-HD do you like it? Maybe you have any other ideas?
emeinhardt
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request