Skip to content

Commit

Permalink
Updated tests with latest version of pytype.
Browse files Browse the repository at this point in the history
  • Loading branch information
erictraut committed Jan 3, 2024
1 parent e9075f8 commit 9fed0f9
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion conformance/results/mypy/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "mypy 1.8.0"
test_duration = 0.5739729404449463
test_duration = 1.3135571479797363
2 changes: 1 addition & 1 deletion conformance/results/pyre/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pyre 0.9.19"
test_duration = 1.835569143295288
test_duration = 2.098888874053955
2 changes: 1 addition & 1 deletion conformance/results/pyright/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pyright 1.1.344"
test_duration = 1.2371001243591309
test_duration = 1.2716259956359863
8 changes: 8 additions & 0 deletions conformance/results/pytype/protocols_generic.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ File "protocols_generic.py", line 13, in <module>: argument "contravariant" to T
File "protocols_generic.py", line 40, in <module>: Type annotation for p2 does not match type of assignment [annotation-type-mismatch]
Annotation: Proto1[int, str]
Assignment: Concrete1
Method __iter__ of protocol Proto1[int, str] has the wrong signature in Concrete1:
>> Proto1[int, str] expects:
def __iter__(self) -> Iterator[T_co]: ...
>> Concrete1 defines:
def __iter__(self) -> Iterator[int]: ...
File "protocols_generic.py", line 44, in <module>: Invalid type annotation 'Proto2' [invalid-annotation]
Cannot inherit from Generic[...] multiple times
File "protocols_generic.py", line 56, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]
Expand Down
10 changes: 2 additions & 8 deletions conformance/results/pytype/protocols_modules.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ notes = """
Does not report incompatibilities for protocol methods.
"""
output = """
File "protocols_modules.py", line 26, in <module>: Type annotation for op2 does not match type of assignment [annotation-type-mismatch]
Annotation: Options2
Assignment: module
Attribute timeout of protocol Options2 has wrong type in module: expected str, got int
File "protocols_modules.py", line 49, in <module>: Type annotation for rp3 does not match type of assignment [annotation-type-mismatch]
Annotation: Reporter3
Assignment: module
Attributes of protocol Reporter3 are not implemented on module: not_implemented
File "protocols_modules.py", line 10, in <module>: Can't find module '_protocols_modules1'. [import-error]
File "protocols_modules.py", line 11, in <module>: Can't find module '_protocols_modules2'. [import-error]
"""
16 changes: 16 additions & 0 deletions conformance/results/pytype/protocols_self.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ File "protocols_self.py", line 37, in <module>: argument "covariant" to TypeVar
File "protocols_self.py", line 72, in <module>: Type annotation for a2 does not match type of assignment [annotation-type-mismatch]
Annotation: P2Parent[str]
Assignment: C2[str]
Method f0 of protocol P2Parent[str] has the wrong signature in C2[str]:
>> P2Parent[str] expects:
def f0(self, right: Self, /) -> P2Parent[T1]: ...
>> C2[str] defines:
def f0(self, other: Self) -> C2[T2_co]: ...
File "protocols_self.py", line 73, in <module>: Type annotation for b2 does not match type of assignment [annotation-type-mismatch]
Annotation: P2Child[str]
Assignment: C2[str]
Method f0 of protocol P2Child[str] has the wrong signature in C2[str]:
>> P2Child[str] expects:
def f0(self, right: Self, /) -> P2Parent[T1]: ...
>> C2[str] defines:
def f0(self, other: Self) -> C2[T2_co]: ...
"""
10 changes: 7 additions & 3 deletions conformance/results/pytype/qualifiers_final_decorator.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ Does not report error for overloaded @final method defined in stub file.
Does not report error for overload that is marked @final when implementation is not.
"""
output = """
File "qualifiers_final_decorator.py", line 8, in <module>: Can't find module '_qualifiers_final_decorator'. [import-error]
File "qualifiers_final_decorator.py", line 8, in <module>: Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error]
File: "_qualifiers_final_decorator.pyi", line 8
class Base3:
^
ParseError: Overloaded signatures for 'method' disagree on final decorators
File "qualifiers_final_decorator.py", line 21, in <module>: Cannot subclass final class: Base1 [final-error]
File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type]
Expected: str
Actually returned: int
File "qualifiers_final_decorator.py", line 55, in <module>: Class Derived2 overrides final method method2, defined in base class Base2 [final-error]
File "qualifiers_final_decorator.py", line 55, in <module>: Class Derived2 overrides final method method3, defined in base class Base2 [final-error]
File "qualifiers_final_decorator.py", line 55, in <module>: Class Derived2 overrides final method method1, defined in base class Base2 [final-error]
File "qualifiers_final_decorator.py", line 55, in <module>: Class Derived2 overrides final method method4, defined in base class Base2 [final-error]
File "qualifiers_final_decorator.py", line 55, in <module>: Class Derived2 overrides final method method3, defined in base class Base2 [final-error]
File "qualifiers_final_decorator.py", line 55, in <module>: Class Derived2 overrides final method method2, defined in base class Base2 [final-error]
File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type]
Expected: str
Actually returned: int
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/pytype/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pytype 2023.12.18"
test_duration = 28.1415696144104
test_duration = 24.716844081878662
8 changes: 4 additions & 4 deletions conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<header>
<h3>Python Type System Conformance Test Results</h3>
</header>
<div class='tc-header'><span class='tc-name'>mypy 1.8.0<span class='tc-time'>(0.57sec)</span>
<div class='tc-header'><span class='tc-name'>mypy 1.8.0<span class='tc-time'>(1.31sec)</span>
</div>
<div class="table_container"><table>
<tr><th class="column spacer" colspan="4"></th></tr>
Expand Down Expand Up @@ -251,7 +251,7 @@ <h3>Python Type System Conformance Test Results</h3>
<tr><th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th class="column col1">directives_version_platform</th><th class="column col2 conformant">Pass</th><th class="column col3">Does not understand three-element form of sys.version checks.<br>Does not understand os.name checks.<br></th></tr>
<tr><th class="column spacer" colspan="4"></th></tr>
</table></div>
<div class='tc-header'><span class='tc-name'>pyright 1.1.344<span class='tc-time'>(1.24sec)</span>
<div class='tc-header'><span class='tc-name'>pyright 1.1.344<span class='tc-time'>(1.27sec)</span>
</div>
<div class="table_container"><table>
<tr><th class="column spacer" colspan="4"></th></tr>
Expand Down Expand Up @@ -375,7 +375,7 @@ <h3>Python Type System Conformance Test Results</h3>
<tr><th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th class="column col1">directives_version_platform</th><th class="column col2 conformant">Pass</th><th class="column col3"></th></tr>
<tr><th class="column spacer" colspan="4"></th></tr>
</table></div>
<div class='tc-header'><span class='tc-name'>pyre 0.9.19<span class='tc-time'>(1.84sec)</span>
<div class='tc-header'><span class='tc-name'>pyre 0.9.19<span class='tc-time'>(2.10sec)</span>
</div>
<div class="table_container"><table>
<tr><th class="column spacer" colspan="4"></th></tr>
Expand Down Expand Up @@ -499,7 +499,7 @@ <h3>Python Type System Conformance Test Results</h3>
<tr><th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th><th class="column col1">directives_version_platform</th><th class="column col2 partially-conformant">Partial</th><th class="column col3">Does not support sys.platform checks.<br>Does not support os.name checks.<br></th></tr>
<tr><th class="column spacer" colspan="4"></th></tr>
</table></div>
<div class='tc-header'><span class='tc-name'>pytype 2023.12.18<span class='tc-time'>(28.14sec)</span>
<div class='tc-header'><span class='tc-name'>pytype 2023.12.18<span class='tc-time'>(24.72sec)</span>
</div>
<div class="table_container"><table>
<tr><th class="column spacer" colspan="4"></th></tr>
Expand Down

0 comments on commit 9fed0f9

Please sign in to comment.