Skip to content

Commit 7e32d48

Browse files
conformance: do not use input() in LiteralString test (#2233)
This makes pycroscope hang forever when it tries to import the module and waits for input.
1 parent 56ffa79 commit 7e32d48

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

conformance/results/mypy/literals_literalstring.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ literals_literalstring.py:43: error: Incompatible types in assignment (expressio
99
literals_literalstring.py:73: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
1010
literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment]
1111
literals_literalstring.py:156: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match]
12-
literals_literalstring.py:166: error: Expression is of type "B", not "A" [assert-type]
12+
literals_literalstring.py:167: error: Expression is of type "B", not "A" [assert-type]
1313
"""
1414
conformance_automated = "Fail"
1515
errors_diff = """
1616
Line 65: Expected 1 errors
1717
Line 119: Expected 1 errors
1818
Line 133: Expected 1 errors
19-
Line 170: Expected 1 errors
19+
Line 171: Expected 1 errors
2020
Line 156: Unexpected errors ["literals_literalstring.py:156: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match]"]
21-
Line 166: Unexpected errors ['literals_literalstring.py:166: error: Expression is of type "B", not "A" [assert-type]']
21+
Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A" [assert-type]']
2222
"""

conformance/results/pyrefly/literals_literalstring.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ ERROR literals_literalstring.py:73:25-26: `Literal[3]` is not assignable to `Lit
1111
ERROR literals_literalstring.py:74:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment]
1212
ERROR literals_literalstring.py:119:21-24: `str` is not assignable to upper bound `LiteralString` of type variable `TLiteral` [bad-specialization]
1313
ERROR literals_literalstring.py:133:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type]
14-
ERROR literals_literalstring.py:170:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment]
14+
ERROR literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment]
1515
"""

conformance/results/pyright/literals_literalstring.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ literals_literalstring.py:119:22 - error: Argument of type "str" cannot be assig
1616
literals_literalstring.py:133:51 - error: Argument of type "str" cannot be assigned to parameter "value" of type "T@Container" in function "__init__"
1717
  Type "str" is not assignable to type "LiteralString"
1818
    "str" is not assignable to "LiteralString" (reportArgumentType)
19-
literals_literalstring.py:170:21 - error: Type "list[LiteralString]" is not assignable to declared type "list[str]"
19+
literals_literalstring.py:171:21 - error: Type "list[LiteralString]" is not assignable to declared type "list[str]"
2020
  "list[LiteralString]" is not assignable to "list[str]"
2121
    Type parameter "_T@list" is invariant, but "LiteralString" is not the same as "str"
2222
    Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType)

conformance/results/ty/literals_literalstring.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ literals_literalstring.py:74:25: error[invalid-assignment] Object of type `Liter
1111
literals_literalstring.py:119:22: error[invalid-argument-type] Argument to function `literal_identity` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `TLiteral`
1212
literals_literalstring.py:133:51: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `T`
1313
literals_literalstring.py:133:51: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `LiteralString`, found `str`
14-
literals_literalstring.py:170:21: error[invalid-assignment] Object of type `list[LiteralString]` is not assignable to `list[str]`
14+
literals_literalstring.py:171:21: error[invalid-assignment] Object of type `list[LiteralString]` is not assignable to `list[str]`
1515
"""

conformance/results/zuban/literals_literalstring.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ literals_literalstring.py:73: error: Incompatible types in assignment (expressio
1010
literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "Literal[b'test']", variable has type "LiteralString") [assignment]
1111
literals_literalstring.py:119: error: Value of type variable "TLiteral" of "literal_identity" cannot be "str" [type-var]
1212
literals_literalstring.py:133: error: Value of type variable "T" of "Container" cannot be "str" [type-var]
13-
literals_literalstring.py:170: error: Incompatible types in assignment (expression has type "list[LiteralString]", variable has type "list[str]") [assignment]
14-
literals_literalstring.py:170: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
15-
literals_literalstring.py:170: note: Consider using "Sequence" instead, which is covariant
13+
literals_literalstring.py:171: error: Incompatible types in assignment (expression has type "list[LiteralString]", variable has type "list[str]") [assignment]
14+
literals_literalstring.py:171: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
15+
literals_literalstring.py:171: note: Consider using "Sequence" instead, which is covariant
1616
"""

conformance/tests/literals_literalstring.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ def func8(x: Any) -> Any:
161161
raise NotImplementedError
162162

163163

164-
assert_type(func8("foo"), C) # First overload
165-
assert_type(func8("bar"), B) # Second overload
166-
assert_type(func8(input()), A) # Third overload
164+
def call_func8(x: str) -> None:
165+
assert_type(func8("foo"), C) # First overload
166+
assert_type(func8("bar"), B) # Second overload
167+
assert_type(func8(x), A) # Third overload
167168

168169

169170
def func9(val: list[LiteralString]):

0 commit comments

Comments
 (0)