-
Notifications
You must be signed in to change notification settings - Fork 33
Don't strip filename from errors #90
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
Comments
I would be great if PyCharm could parse the output like it does other tests run by pytest. |
In pypa/setuptools#4502, we've dived deep into this issue and find the default behavior of pytest-mypy to be suboptimal. It's inconsistent with the output from other tools, including mypy itself, which include the relative file path on each line. As pointed out, without this path, editors like VSCode and Pycharm are unable to provide easy hyperlinks to the relevant causes. The hook to customize the output is nice, but it requires each and every downstream project to implement something, or for someone to write yet another plugin to customize the behavior. Ideally, pytest-mypy would provide a default that's consistent with other tools and friendly to developers out of the box. Would this project consider one or more of these options:
Feel free to transfer this comment to a new issue if you agree. |
I have implemented this in #193 ( |
These lines strip the file name from the reported errors.
https://github.com/dbader/pytest-mypy/blob/8c99601158157ad96698d5a89357035e701bcf90/src/pytest_mypy.py#L234-L237
While this results in a cleaner looking output, it means the output is less useful when using pytest-mypy with other tools like Pycharm. When I change the code to include the filename, Pycharm turns it into a link which I can click to bring me directly to the place where the error is. Without the filename this doesn't work.
The text was updated successfully, but these errors were encountered: