Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance test suite: Fix automation discrepancies in directives_version_platform #1685

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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)