Skip to content

Commit 9df7bdf

Browse files
authored
Adjust error locations for typeddicts_class_syntax conformance test (#1980)
* allow alternative locations for some typeddict method errors * update results
1 parent 0b9fed8 commit 9df7bdf

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

conformance/results/mypy/version.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "mypy 1.15.0"
2-
test_duration = 2.1
2+
test_duration = 2.3

conformance/results/pyre/typeddicts_class_syntax.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ typeddicts_class_syntax.py:49:0 Unexpected keyword [28]: Unexpected keyword argu
1111
conformance_automated = "Fail"
1212
errors_diff = """
1313
Line 29: Expected 1 errors
14-
Line 33: Expected 1 errors
15-
Line 38: Expected 1 errors
1614
Line 44: Expected 1 errors
15+
Lines 33, 34: Expected error (tag 'method2')
16+
Lines 38, 39: Expected error (tag 'method3')
1717
"""

conformance/results/pyre/version.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "pyre 0.9.23"
2-
test_duration = 3.9
2+
test_duration = 8.2
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "pyright 1.1.398"
2-
test_duration = 2.3
1+
version = "pyright 1.1.399"
2+
test_duration = 1.4

conformance/results/pytype/protocols_merging.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Does not report attempt to instantiate abstract class downgraded from protocol c
66
output = """
77
protocols_merging.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: Type annotation for s6 does not match type of assignment [annotation-type-mismatch]
88
9-
s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement close
9+
s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement `__len__`
1010
\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m
1111
1212
protocols_merging.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: Type annotation for s7 does not match type of assignment [annotation-type-mismatch]
1313
14-
s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement close
14+
s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement `__len__`
1515
\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m
1616
1717
protocols_merging.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: Type annotation for s8 does not match type of assignment [annotation-type-mismatch]

conformance/results/pytype/typeddicts_class_syntax.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class GenericTypedDict(TypedDict, Generic[T]):
1818
conformance_automated = "Fail"
1919
errors_diff = """
2020
Line 29: Expected 1 errors
21-
Line 33: Expected 1 errors
22-
Line 38: Expected 1 errors
2321
Line 44: Expected 1 errors
2422
Line 49: Expected 1 errors
23+
Lines 33, 34: Expected error (tag 'method2')
24+
Lines 38, 39: Expected error (tag 'method3')
2525
Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: Invalid base class: Generic[T] [base-class-error]']
2626
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "pytype 2024.10.11"
2-
test_duration = 43.3
2+
test_duration = 35.2

conformance/results/results.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,16 @@ <h3>Python Type System Conformance Test Results</h3>
159159
<div class="table_container"><table><tbody>
160160
<tr><th class="col1">&nbsp;</th>
161161
<th class='tc-header'><div class='tc-name'>mypy 1.15.0</div>
162-
<div class='tc-time'>2.1sec</div>
163-
</th>
164-
<th class='tc-header'><div class='tc-name'>pyright 1.1.398</div>
165162
<div class='tc-time'>2.3sec</div>
166163
</th>
164+
<th class='tc-header'><div class='tc-name'>pyright 1.1.399</div>
165+
<div class='tc-time'>1.4sec</div>
166+
</th>
167167
<th class='tc-header'><div class='tc-name'>pyre 0.9.23</div>
168-
<div class='tc-time'>3.9sec</div>
168+
<div class='tc-time'>8.2sec</div>
169169
</th>
170170
<th class='tc-header'><div class='tc-name'>pytype 2024.10.11</div>
171-
<div class='tc-time'>43.3sec</div>
171+
<div class='tc-time'>35.2sec</div>
172172
</th>
173173
</tr>
174174
<tr><th class="column" colspan="5">
@@ -445,10 +445,10 @@ <h3>Python Type System Conformance Test Results</h3>
445445
<a class="test_group" href="https://typing.readthedocs.io/en/latest/spec/class-compat.html">Class type compatibility</a>
446446
</th></tr>
447447
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;classes_classvar</th>
448-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Internal error if TypeVarTuple is used in ClassVar.</p><p>Does not reject use of ParamSpec in ClassVar.</p><p>Rejects ClassVar nested in Annotated.</p><p>Does not reject use of ClassVar in TypeAlias definition.</p><p>Does not infer type of ClassVar from assignment if no type is provided.</p></span></div></th>
448+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Internal error if TypeVarTuple is used in ClassVar.</p><p>Does not reject use of ParamSpec in ClassVar.</p><p>Rejects ClassVar nested in Annotated.</p><p>Does not reject use of ClassVar in TypeAlias definition.</p></span></div></th>
449449
<th class="column col2 conformant">Pass</th>
450450
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject use of TypeVar in ClassVar.</p><p>Does not reject use of ParamSpec in ClassVar.</p><p>Does not reject use of ClassVar as a generic type argument.</p><p>Does not reject use of ClassVar in parameter type annotation.</p><p>Does not reject use of ClassVar in local variable annotation.</p><p>Does not reject use of ClassVar in instance variable annotation.</p><p>Does not reject use of ClassVar in return type annotation.</p><p>Does not reject use of ClassVar in type alias definition.</p><p>Does not infer type from initialization for bare ClassVar.</p></span></div></th>
451-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject use of TypeVar in ClassVar.</p><p>Does not reject use of ParamSpec in ClassVar.</p><p>Does not reject use of ClassVar as a generic type argument.</p><p>Rejects initialization of ClassVar if no type argument is provided.</p><p>Does not reject use of ClassVar in parameter type annotation.</p><p>Does not reject use of ClassVar in local variable annotation.</p><p>Does not reject use of ClassVar in instance variable annotation.</p><p>Does not reject use of ClassVar in return type annotation.</p><p>Does not reject use of ClassVar in type alias definition.</p><p>Does not reject assignment of ClassVar through instance of class.</p></span></div></th>
451+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject use of TypeVar in ClassVar.</p><p>Does not reject use of ParamSpec in ClassVar.</p><p>Does not reject use of ClassVar as a generic type argument.</p><p>Rejects initialization of ClassVar if no type argument is provided.</p><p>Does not infer ClassVar with no type argument and no assigned value as Any.</p><p>Does not reject use of ClassVar in parameter type annotation.</p><p>Does not reject use of ClassVar in local variable annotation.</p><p>Does not reject use of ClassVar in instance variable annotation.</p><p>Does not reject use of ClassVar in return type annotation.</p><p>Does not reject use of ClassVar in type alias definition.</p><p>Does not reject assignment of ClassVar through instance of class.</p></span></div></th>
452452
</tr>
453453
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;classes_override</th>
454454
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not handle case where parent class derives from Any.</p></span></div></th>

conformance/tests/typeddicts_class_syntax.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def method1(self): # E
3030
pass
3131

3232
# Methods are not allowed, so this should generate an error.
33-
@classmethod # E
34-
def method2(cls):
33+
@classmethod # E[method2]
34+
def method2(cls): # E[method2]
3535
pass
3636

3737
# Methods are not allowed, so this should generate an error.
38-
@staticmethod # E
39-
def method3():
38+
@staticmethod # E[method3]
39+
def method3(): # E[method3]
4040
pass
4141

4242

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy