Add stdout and stderr to mypy status error#134
Open
scriptator wants to merge 1 commit intorealpython:mainfrom
Open
Add stdout and stderr to mypy status error#134scriptator wants to merge 1 commit intorealpython:mainfrom
scriptator wants to merge 1 commit intorealpython:mainfrom
Conversation
dmtucker
reviewed
Jun 11, 2022
Collaborator
dmtucker
left a comment
There was a problem hiding this comment.
Hey there 👋 Thanks for the contribution!
My only hesitance with this is that it will lead to duplicate output in most cases...
============================ FAILURES ============================
_______________________ demo/test_demo.py ________________________
2: error: Incompatible return value type (got "str", expected "int")
__________________________ test session __________________________
mypy exited with status 1.
stdout: demo/test_demo.py:2: error: Incompatible return value type (got "str", expected "int")
Found 1 error in 1 file (checked 1 source file)
stderr:
============================== mypy ==============================
Found 1 error in 1 file (checked 1 source file)
I understand #120 to be an issue regarding the use of -x, and in that issue you mention needing this patch for debugging an error on your CI server. Are you using -x in that workflow?
I mainly ask because if the issue was MypyStatusError being raised on a file that wasn't collected by Pytest, that output should already be shown as unmatched_stdout:
https://github.com/dbader/pytest-mypy/blob/3c9d8d5ff8d090e63d80a7a7c6c82d37b0ae2d2a/src/pytest_mypy.py#L329-L331
============================ FAILURES ============================
__________________________ test session __________________________
mypy exited with status 1.
============================== mypy ==============================
demo/uncollected.py:1: error: Incompatible types in assignment (expression has type "int", variable has type "str")
Found 1 error in 1 file (checked 1 source file)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to #120 : adds further information to the error message so that the mentioned issue can be more easily debugged (e.g. on CI environments)