Skip to content
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

Support for mypy .test files. #79

Open
zero323 opened this issue Oct 14, 2021 · 3 comments
Open

Support for mypy .test files. #79

zero323 opened this issue Oct 14, 2021 · 3 comments

Comments

@zero323
Copy link
Contributor

zero323 commented Oct 14, 2021

This is a feature request.

It might be nice to get support for handling mypy-style .test files:

[case foo]

reveal_type(1 + 1)  # N: Revealed type is "builtins.int"

[out]]

-- Comment

[case bar]

reveal_type(1 + 1)

[out]
main:2: note: Revealed type is "builtins.int"

@sobolevn
Copy link
Member

Why not just use mypy's test then? It is a completely different format 🤔

@zero323
Copy link
Contributor Author

zero323 commented Oct 14, 2021

Why not just use mypy's test then?

Good question. I guess that depends on the use case. I used mypy tests in the past, and accumulated a lot of test files. However:

  • It is internal and undocumented feature.
  • It assumes rather specific project layout.

So it is hard sell for more strict projects.

Additionally, supporting these here, would allow smoother migration without keeping track of what should go into mypy.test.testcheck.TypeCheckSuite.files. Huge win for me :)

It is a completely different format 🤔

Up to certain point. Once you parse input file into cases containing:

  • options: Optional[str]
  • main: str
  • out:str

handling both main and out shouldn't require additional logic (inline comment format is the same, and out is just mypy output).

I am aware that it might be out-of-scope here, just the idea :)

@sobolevn
Copy link
Member

sobolevn commented Oct 14, 2021

Another idea: mypy's .test files converter into our yml format? 🤔
It might be easier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants