pytest-mypy-plugins
pytest-mypy-plugins copied to clipboard
Add option to ignore `*` and `1 in types
There are cases when some types are revealed like:
# N: Revealed type is 'builtins.bool*'
Or like so:
reveal_type(dekind(container)) # N: Revealed type is 'main.IO[def (_ValueType`1) -> _NewValueType`-1]'
Here are the problems with these two things:
- They can change! Sometimes if you use a different technique inside your type, you will loose this
*
while everything else will work the exact same way - Different versions of python in different environments might produce different numeric results after
`
char in type vars.
So, I propose to add strict: false
parameter to our test cases to ignore these chars (and possibly other things in the future).
I like strict_assert: false
more. And probably we would also need a command line flag: --mypy-strict-assert
PR #55 might cover this use case, though in a different way. Thoughts?