Skip to content

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

Merged
merged 5 commits into from
Jun 1, 2017
Merged

Add additional quick mode test cases #3480

merged 5 commits into from
Jun 1, 2017

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 31, 2017

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.

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.
Copy link
Member

@gvanrossum gvanrossum left a 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]
Copy link
Member

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]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe 'Persisting'?

Copy link
Collaborator Author

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]
Copy link
Member

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?

Copy link
Collaborator Author

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

Copy link
Member

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.)

Copy link
Collaborator Author

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]
Copy link
Member

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?

Copy link
Collaborator Author

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
Copy link
Member

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?

Copy link
Collaborator Author

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.

@JukkaL JukkaL merged commit e102c6a into master Jun 1, 2017
carljm added a commit to carljm/mypy that referenced this pull request Jun 3, 2017
* 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)
@gvanrossum gvanrossum deleted the test-3-quick branch June 19, 2017 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants