Skip to content

Commit

Permalink
conformance tests: fix scoring for typeddicts_inheritance (python#1705)
Browse files Browse the repository at this point in the history
Pyre and pytype produced an expected error on the wrong line.

Part of python#1692
  • Loading branch information
JelleZijlstra committed Apr 11, 2024
1 parent 8537aac commit e253bf6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions conformance/results/pyre/typeddicts_inheritance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ typeddicts_inheritance.py:65:0 Invalid inheritance [39]: Field `x` has type `int
conformance_automated = "Fail"
errors_diff = """
Line 44: Expected 1 errors
Line 55: Expected 1 errors
Line 54: Unexpected errors ['typeddicts_inheritance.py:54:0 Inconsistent override [15]: `x` overrides attribute defined in `X1` inconsistently. Type `int` is not a subtype of the overridden attribute `str`.']
"""
4 changes: 1 addition & 3 deletions conformance/results/pytype/typeddicts_inheritance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ File "typeddicts_inheritance.py", line 44, in <module>: Invalid base class: NonT
File "typeddicts_inheritance.py", line 54, in <module>: Invalid base class: X1 [base-class-error]
File "typeddicts_inheritance.py", line 65, in <module>: Invalid base class: Y2 [base-class-error]
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 55: Expected 1 errors
Line 54: Unexpected errors ['File "typeddicts_inheritance.py", line 54, in <module>: Invalid base class: X1 [base-class-error]']
"""
4 changes: 2 additions & 2 deletions conformance/tests/typeddicts_inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class BadTypedDict(TypedDict, NonTypedDict): # E
class X1(TypedDict):
x: str

class Y1(X1):
x: int # E: cannot overwrite TypedDict field "x"
class Y1(X1): # E[Y1]
x: int # E[Y1]: cannot overwrite TypedDict field "x"


# > Multiple inheritance does not allow conflict types for the same name field:
Expand Down

0 comments on commit e253bf6

Please sign in to comment.