@@ -55,6 +55,45 @@ def test_bar(x: str):
55
55
assert _get_pyright_errors (file ) == []
56
56
57
57
58
+ def test_pyright_issue_3296 (tmp_path : Path ):
59
+ file = tmp_path / "test.py"
60
+ file .write_text (
61
+ textwrap .dedent (
62
+ """
63
+ from hypothesis.strategies import lists, integers
64
+
65
+ reveal_type(lists(integers()).map(sorted), expected_text="SearchStrategy[list[int]]")
66
+ """
67
+ )
68
+ )
69
+ _write_config (tmp_path , {"typeCheckingMode" : "strict" })
70
+ assert _get_pyright_errors (file ) == []
71
+
72
+
73
+ def test_pyright_raises_for_mixed_pos_kwargs_in_given (tmp_path : Path ):
74
+ file = tmp_path / "test.py"
75
+ file .write_text (
76
+ textwrap .dedent (
77
+ """
78
+ from hypothesis import given
79
+ from hypothesis.strategies import text
80
+
81
+ @given(text(), x=text()) # type: ignore
82
+ def test_bar(x):
83
+ ...
84
+ """
85
+ )
86
+ )
87
+ _write_config (
88
+ tmp_path ,
89
+ {
90
+ "typeCheckingMode" : "strict" ,
91
+ "reportUnnecessaryTypeIgnoreComment" : "true" ,
92
+ },
93
+ )
94
+ assert _get_pyright_errors (file ) == []
95
+
96
+
58
97
# ---------- Helpers for running pyright ---------- #
59
98
60
99
@@ -63,7 +102,7 @@ def _get_pyright_output(file: Path) -> dict[str, Any]:
63
102
[tool_path ("pyright" ), "--outputjson" ],
64
103
cwd = file .parent ,
65
104
encoding = "utf-8" ,
66
- universal_newlines = True ,
105
+ text = True ,
67
106
capture_output = True ,
68
107
)
69
108
return json .loads (proc .stdout )
0 commit comments