typeddjango / pytest-mypy-plugins

pytest plugin for testing mypy types, stubs, and plugins
https://pypi.org/project/pytest-mypy-plugins/
MIT License
100 stars 26 forks source link

greater-than sign in parametrized values (to check function return values) #110

Open jakkdl opened 1 year ago

jakkdl commented 1 year ago
- case: foo
  parametrized:
    - val: bool
      rt: 'def (builtins.object =) -> builtins.bool'
  main: |
    reveal_type({{ val }})  # N: Revealed type is "{{ rt }}"
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output: 
E   Actual:
E     main:1: note: Revealed type is "def (builtins.object =) -> builtins.bool" (diff)
E   Expected:
E     main:1: note: Revealed type is "def (builtins.object =) -> bool" (diff)
E   Alignment of first line difference:
E     E: ... "def (builtins.object =) -> bool"
E     A: ... "def (builtins.object =) -> builtins.bool"
E                                      ^

This is not due to yaml, but due to chevron escaping html characters. Only way to get around it is to not use parametrized, which makes for a lot more repeated code