Skip to content

Conversation

scriptator
Copy link

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)

Copy link
Collaborator

@dmtucker dmtucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants