You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module "hamcrest" does not explicitly export attribute "assert_that"; implicit reexport disabled
note: type checking works fine with no_implicit_reexport=false: if you don't pass a matcher to assert_that you get an error.
So i'm not sure what to make of this...
mitigation
Setting no_implicit_reexport=false obviously solves the problem... but it would be better to keep it for other repos. Unless there's a way to specify this only for pyhamcrest
Using # type: ignore on the from hamcrest import assert_that, is_ line disable the warning along with type checking
Hello!
Always been a great fan of this library!
Disclaimer: I'm new to mypy, so this might just be me lacking understadings, if so, i'm sorry i'll close this.
I'm trying to introduce mypy strict=true to my test suite and notice 2 things:
The documented way of importing does seem to fail on mypy.
Results in
note: vscode also does not recognize import *... unless i miss an extension other than python
If imported manually, there seems to be an issue with dynamically created
__all__
.Results in
note: type checking works fine with
no_implicit_reexport=false
: if you don't pass a matcher to assert_that you get an error.So i'm not sure what to make of this...
mitigation
no_implicit_reexport=false
obviously solves the problem... but it would be better to keep it for other repos. Unless there's a way to specify this only for pyhamcrestfrom hamcrest import assert_that, is_
line disable the warning along with type checkingreproduce
Here's a repo with 3 files that produce error, reproduce steps are in the readme
https://github.com/lindycoder/pyhamcrest-mypy-issue
Thank you very much!
The text was updated successfully, but these errors were encountered: