-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide mechanism for intent objects to document (and perhaps enforce) types for inputs and outputs #4
Comments
The title of this ticket doesn't really make sense as a bug. Can you please rewrite it? |
resolve_effect
and claim that mocking is OK ignore lack of static typing
I'm sorry I didn't notice this change when you made it, I don't think github sent me a notification :-( Anyway, that title is a lot more helpful, thank you. However, I would suggest that this is probably something that a separate library should tackle. It should be easy enough to apply a static-typing wrapper to your intent objects and perform implementations. Does that sound reasonable? |
@itamarst I was playing with the idea of doing this in python a while back. I haven't really shown anyone though. You can do things like strict type checking for example |
You may also want to check out MyPy, which adds static typing to Python. I'll close this issue for now, since I think it's clear this is the responsibility of other libraries. |
In a language with a good type system you can be sure that the result you swapped in as part of a test vaguely make sense. In Python it's easy to write tests using mocks or resolved values where you end up testing against return types that don't match what the real function returns.
Perhaps intent objects should have a way document or provide validation functions for the return types and callable arguments. Then tests that use
resolve_effect
(as well as those that test the intent itself) can automatically ensure the tests are using the correct types.The text was updated successfully, but these errors were encountered: