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.
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
Add mypy plugin for NewType #55
Add mypy plugin for NewType #55
Changes from 2 commits
99e1dad
e477ccc
2326e4d
f3f7f5a
c65fe84
488f994
c0184c8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you use
tempfile.TemporaryDirectory
for this?Sidenote: this is another good time to re-evaluate pytest, which has built-in functionality for this sort of thing. Not a blocker, but worth considering. @lovasoa
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.
I argued against pytest in the past because I felt like it wasn't providing anything we needed for this project. But if there is a plugin that allows testing the mypy plugin easily, then I have nothing against switching to pytest and using it. It would definitely make the transition worth it.
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.
Argh. Deleted previous comment by accident. Copied below for reference.
Hah, yeah I must admit I was bit surprised that this was using unittest. Note that there's also a pytest plugin to easily test mypy plugins, which would effectively remove the need for all the code in setup, teardown and assert_mypy_output.
Do you want me to leave a TODO somewhere, as a reminder to switch to (or at least consider) pytest-mypy-plugins if the project moves to pytest?
Also note that pytest supports unittest, so you could use the pytest runner without necessarily "rewriting" the existing tests.
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.
@lovasoa Cool. How do you want to proceed re: existing tests and re: this PR?
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.
Since switching to pytest doesn't require rewriting any of the existing tests, I think we can do it in this PR.
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.
Alright! Will work on that later today.