Skip to content

Commit

Permalink
Conformance test suite: Fix automation discrepancies in directives_ve…
Browse files Browse the repository at this point in the history
…rsion_platform (#1685)
  • Loading branch information
JelleZijlstra authored Apr 8, 2024
1 parent f14091a commit 392353c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
6 changes: 1 addition & 5 deletions conformance/results/mypy/directives_version_platform.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ directives_version_platform.py:27: error: Incompatible types in assignment (expr
directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 19: Unexpected errors ['directives_version_platform.py:19: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]']
Line 27: Unexpected errors ['directives_version_platform.py:27: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]']
Line 40: Unexpected errors ['directives_version_platform.py:40: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]']
Line 45: Unexpected errors ['directives_version_platform.py:45: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]']
"""
2 changes: 0 additions & 2 deletions conformance/results/pyre/directives_version_platform.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ conformance_automated = "Fail"
errors_diff = """
Line 31: Unexpected errors ['directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`.']
Line 36: Unexpected errors ['directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`.']
Line 40: Unexpected errors ['directives_version_platform.py:40:4 Incompatible variable type [9]: val7 is declared to have type `int` but is used as type `str`.']
Line 45: Unexpected errors ['directives_version_platform.py:45:4 Incompatible variable type [9]: val8 is declared to have type `int` but is used as type `str`.']
"""
5 changes: 1 addition & 4 deletions conformance/results/pytype/directives_version_platform.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ File "directives_version_platform.py", line 27, in <module>: Type annotation for
File "directives_version_platform.py", line 40, in <module>: Type annotation for val7 does not match type of assignment [annotation-type-mismatch]
File "directives_version_platform.py", line 45, in <module>: Type annotation for val8 does not match type of assignment [annotation-type-mismatch]
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 27: Unexpected errors ['File "directives_version_platform.py", line 27, in <module>: Type annotation for val3 does not match type of assignment [annotation-type-mismatch]']
Line 40: Unexpected errors ['File "directives_version_platform.py", line 40, in <module>: Type annotation for val7 does not match type of assignment [annotation-type-mismatch]']
Line 45: Unexpected errors ['File "directives_version_platform.py", line 45, in <module>: Type annotation for val8 does not match type of assignment [annotation-type-mismatch]']
"""
8 changes: 4 additions & 4 deletions conformance/tests/directives_version_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
if sys.version_info >= (3, 8, 0):
pass
else:
val2: int = "" # Should not generate an error
val2: int = "" # E?: May not generate an error (support for three-element sys.version is optional)

if sys.version_info < (3, 8):
val3: int = "" # Should not generate an error

if sys.version_info < (3, 100, 0):
pass
else:
val3: int = "" # Should not generate an error
val3: int = "" # E?: May not generate an error (support for three-element sys.version is optional)


if sys.platform == "bogus_platform":
Expand All @@ -37,9 +37,9 @@


if os.name == "bogus_os":
val7: int = "" # Should not generate an error
val7: int = "" # E?: May not generate an error (support for os.name is optional)

if os.name != "bogus_platform":
pass
else:
val8: int = "" # Should not generate an error
val8: int = "" # E?: May not generate an error (support for os.name is optional)

0 comments on commit 392353c

Please sign in to comment.