sqlalchemy-stubs icon indicating copy to clipboard operation
sqlalchemy-stubs copied to clipboard

Consider using pytest-mypy-plugins

Open sobolevn opened this issue 6 years ago • 1 comments

Hi! Thanks for this awesome project!

I am TypedDjango team member, we maintain types for, well, django. And we do pretty much the same job.

For example, we also test our types the similar way as you do in tests/. We even created a tool called pytest-mypy-plugins (announcing post) to help us with this task. Maybe it will be also helpful to you as well.

That's how the simplest test looks like:

- case: compose_two_wrong_functions
  main: |
    from returns.functions import compose

    def first(num: int) -> float:
        return float(num)

    def second(num: float) -> str:
        return str(num)

    reveal_type(compose(first, second)(1))  # N: builtins.str*

In case you like - I can send a PR with the refactored tests. Or we can collaborate on this together.

Ask any questions you have!

P.S. This project was listed in awesome-python-stubs list.

sobolevn avatar Sep 11 '19 09:09 sobolevn

I like the idea of trying this. I will however not have time to rewrite the tests myself, so would be great if you can do this.

(You will need to sign the CLA, see README.)

ilevkivskyi avatar Sep 11 '19 21:09 ilevkivskyi