diff --git a/test-data/unit/check-literal.test b/test-data/unit/check-literal.test index 0b779f57b615..8d25a58b9556 100644 --- a/test-data/unit/check-literal.test +++ b/test-data/unit/check-literal.test @@ -21,6 +21,13 @@ reveal_type(i2) # N: Revealed type is "def (x: Literal['A|B'])" [builtins fixtures/tuple.pyi] [out] +[case testLiteralWithBackslash-skip] +-- This should be an xfail but since it fails on *only* Windows, not consistently, we must skip instead. +-- TODO: someday this test should simply pass. Once https://github.com/python/mypy/issues/20884 is fixed. +-- This test case is more to test mypy backslash handling than anything else +from typing import Literal +x: Literal[" \ "] = 1 # E: Incompatible types in assignment (expression has type "Literal[1]", variable has type "Literal[' \\ ']") + [case testLiteralInvalidTypeComment] from typing import Literal def f(x): # E: Syntax error in type comment "(A[) -> None"