-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added command-line option "--report-only" that regenerates the report summary without re-running the tests. * Updated conformance suite to reflect recent change to spec regarding the use of a unary `+` within a `Literal` type annotation.
- Loading branch information
Showing
8 changed files
with
108 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
conformant = "Partial" | ||
notes = """ | ||
Rejects integer Literal with unary `+` operator. | ||
Does not reject tuple within Literal. | ||
""" | ||
output = """ | ||
literals_parameterizations.py:40: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:20: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:41: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:46: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:47: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:50: error: Parameter 1 of Literal[...] cannot be of type "float" [valid-type] | ||
literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "Any" [valid-type] | ||
literals_parameterizations.py:52: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:55: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:58: error: Literal[...] must have at least one parameter [valid-type] | ||
literals_parameterizations.py:59: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:63: error: Incompatible types in assignment (expression has type "Literal[Color.RED]", variable has type "Literal['Color.RED']") [assignment] | ||
literals_parameterizations.py:50: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" [valid-type] | ||
literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" [valid-type] | ||
literals_parameterizations.py:53: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] | ||
literals_parameterizations.py:60: error: Literal[...] must have at least one parameter [valid-type] | ||
literals_parameterizations.py:61: error: Parameter 1 of Literal[...] is invalid [valid-type] | ||
literals_parameterizations.py:65: error: Incompatible types in assignment (expression has type "Literal[Color.RED]", variable has type "Literal['Color.RED']") [assignment] | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Command-line options for the test tool. | ||
""" | ||
|
||
import argparse | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class _Options: | ||
report_only: bool | None | ||
|
||
|
||
def parse_options(argv: list[str]) -> _Options: | ||
parser = argparse.ArgumentParser() | ||
reporting_group = parser.add_argument_group("reporting") | ||
reporting_group.add_argument( | ||
"--report-only", | ||
action="store_true", | ||
help=("regenerates the test suite report from past results"), | ||
) | ||
ret = _Options(**vars(parser.parse_args(argv))) | ||
return ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters