Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix fine-grained tests
  • Loading branch information
pkch committed Apr 13, 2017
commit ef70f3ef956aa1b495f2ae9aef05d5c92f912094
6 changes: 4 additions & 2 deletions mypy/server/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ def visit_tuple_type(self, typ: TupleType) -> List[str]:
raise NotImplementedError

def visit_type_type(self, typ: TypeType) -> List[str]:
raise NotImplementedError
# TODO: replace with actual implementation
return []

def visit_type_var(self, typ: TypeVarType) -> List[str]:
raise NotImplementedError
# TODO: replace with actual implementation
return []

def visit_typeddict_type(self, typ: TypedDictType) -> List[str]:
raise NotImplementedError
Expand Down
24 changes: 12 additions & 12 deletions test-data/unit/fine-grained.test
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def g(x: str) -> None: pass
[builtins fixtures/fine_grained.pyi]
[out]
==
main:3: error: "module" has no attribute "f"
main:3: error: "ModuleType" has no attribute "f"

[case testTopLevelMissingModuleAttribute]
import m
Expand All @@ -81,7 +81,7 @@ def g(x: int) -> None: pass
[builtins fixtures/fine_grained.pyi]
[out]
==
main:2: error: "module" has no attribute "f"
main:2: error: "ModuleType" has no attribute "f"

[case testClassChangedIntoFunction]
import m
Expand Down Expand Up @@ -241,7 +241,7 @@ class A: pass
[builtins fixtures/fine_grained.pyi]
[out]
==
main:3: error: "module" has no attribute "A"
main:3: error: "ModuleType" has no attribute "A"
==

[case testContinueToReportTypeCheckError]
Expand Down Expand Up @@ -281,10 +281,10 @@ class A: pass
[builtins fixtures/fine_grained.pyi]
[out]
==
main:3: error: "module" has no attribute "A"
main:5: error: "module" has no attribute "B"
main:3: error: "ModuleType" has no attribute "A"
main:5: error: "ModuleType" has no attribute "B"
==
main:5: error: "module" has no attribute "B"
main:5: error: "ModuleType" has no attribute "B"

[case testContinueToReportErrorAtTopLevel]
import n
Expand Down Expand Up @@ -348,9 +348,9 @@ def g() -> None: pass
[builtins fixtures/fine_grained.pyi]
[out]
main:3: error: Too few arguments for "f"
main:5: error: "module" has no attribute "g"
main:5: error: "ModuleType" has no attribute "g"
==
main:5: error: "module" has no attribute "g"
main:5: error: "ModuleType" has no attribute "g"
==

[case testKeepReportingErrorIfNoChanges]
Expand All @@ -361,9 +361,9 @@ def h() -> None:
[file m.py.2]
[builtins fixtures/fine_grained.pyi]
[out]
main:3: error: "module" has no attribute "g"
main:3: error: "ModuleType" has no attribute "g"
==
main:3: error: "module" has no attribute "g"
main:3: error: "ModuleType" has no attribute "g"

[case testFixErrorAndReintroduce]
import m
Expand All @@ -375,10 +375,10 @@ def g() -> None: pass
[file m.py.3]
[builtins fixtures/fine_grained.pyi]
[out]
main:3: error: "module" has no attribute "g"
main:3: error: "ModuleType" has no attribute "g"
==
==
main:3: error: "module" has no attribute "g"
main:3: error: "ModuleType" has no attribute "g"

[case testAddBaseClassMethodCausingInvalidOverride]
import m
Expand Down
4 changes: 3 additions & 1 deletion test-data/unit/fixtures/fine_grained.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# TODO: Migrate to regular stubs once fine-grained incremental is robust
# enough to handle them.

import types

class Any: pass

class object:
Expand All @@ -21,4 +23,4 @@ class bytes: pass
class tuple: pass
class function: pass
class ellipsis: pass
class module: pass
class list: pass