-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 [email protected] #139
Conversation
Both versions were previously incompatible with dev-python/mypy-1.8.0 due to an incompatibility with mypy's new flush_errors signature. See also: typeddjango/pytest-mypy-plugins#139 Signed-off-by: Lucio Sauer <[email protected]>
@antecrescent I suggest making a |
I've tried two possible approaches but 'm not sure how to proceed and I'd be happy to hear your thoughts.
|
|
I may not understand your suggestion correctly... This also fails at runtime for the same reason listed in the first approach: |
@antecrescent please, take a look at my suggestion :) |
Ah yes, makes sense! I'm not very versed in Python but this seems to be a more sensible approach. I'll rebase this to get rid my erroneous commit and fix a typo in your comment. |
mypy's flush_errors function has a different arity for different versions. <mypy-1.8.0: 2 >=mypy-1.8.0: 3 (our flush_errors discards the first 'filename' parameter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thank you for helping me fix this and teaching me a bit of Python :P |
…o#139) mypy's flush_errors function has a different arity for different versions. <mypy-1.8.0: 2 >=mypy-1.8.0: 3 (our flush_errors discards the first 'filename' parameter)
mypy-1.8.0 added a third parameter to the flush_error signature (python/mypy@8c57df0). 97aff1e updated
flush_error
inpytest_mypy_plugins/item.py
to match it, but failed taking into account that <mypy-1.8.0 still expects the two-parameter signature to flush errors after a file is processed.As a consequence, pytest test cases fail if mypy's
process_stale_scc
function calls our three-parameterflush_error
with two arguments.I'm not familiar with the innards of mypy but this happens every time pytest runs with the
--mypy-same-process
option.Reproducible setup:
Output
Issue
pip install mypy==1.8.0
and the same test run succeeds.