-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add additional quick mode test cases #3480
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
Conversation
Some of these are currently skipped because they are crashing. Add more descriptive names to existing --quick test cases. Also minor tweaks to existing test cases.
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.
Basically LGTM. You can address the issues below or not and merge this yourself.
@@ -2080,7 +2084,7 @@ import a | |||
[rechecked a, b, builtins] | |||
[stale a, b, builtins] | |||
|
|||
[case testQuickAndDirty4] | |||
[case testQuickAndDirtyIntroduceErrorToExistingFunction] |
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.
Actually this test seems to clear an existing error. So maybe FixErrorInExistingFunction?
@@ -2112,7 +2116,7 @@ tmp/a.py:2: error: Incompatible return value type (got "str", expected "int") | |||
[rechecked a] | |||
[stale] | |||
|
|||
[case testQuickAndDirty6] | |||
[case testQuickAndDirtyExistingError] |
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.
Maybe 'Persisting'?
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.
Updated
@@ -2130,7 +2134,7 @@ tmp/a.py:2: error: Incompatible return value type (got "float", expected "int") | |||
[rechecked a] | |||
[stale] | |||
|
|||
[case testQuickAndDirty7] | |||
[case testQuickAndDirtyIntroduceReferencesWithinCycle] |
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.
This test and the next also introduce errors (due to reveal_type()) in the cycle -- maybe we need separate tests that introduce references without the errors?
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.
Added two additional test cases
[file b.py] | ||
from typing import TypeVar, Generic | ||
import a | ||
|
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.
No need for blank lines in this file IMO. (Same in the next test.)
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.
Updated
[file b.py] | ||
def f() -> None: pass | ||
[delete b.py.2] | ||
[file c.py] |
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.
Should this be c.py.2?
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.
Yes -- good catch
@@ -2285,7 +2289,7 @@ S = str | |||
import b | |||
def f(x: b.S) -> int: return 0 |
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.
The remaining tests don't have [rechecked] and [stale] fields -- not sure if this is intentional?
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.
Yes, they seemed to not add value when multiple test cases are very similar. I double checked and added those when they actually seemed useful.
* master: Improve test output when a test doesn't specify the correct fixture (python#3488) Speed up tests by simplifying the stub for typing (python#3486) Clean up test fixtures (python#3485) Add additional quick mode test cases (python#3480) Add --strict-optional on by default to roadmap (python#3478) Minor speed-up in warn-return-any (python#3481)
Some of these are currently skipped because they are crashing.
Add more descriptive names to existing --quick test cases.
Also minor tweaks to existing test cases.