Skip to content

Commit 9f42959

Browse files
fix test
1 parent ba09a58 commit 9f42959

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

tests/v1/codegen/test_input_special_chars.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ def test_init_special_chars_typeddict() -> None:
166166
)
167167

168168

169+
class UnclosableStringIO(StringIO):
170+
def close(self) -> None:
171+
pass
172+
173+
169174
def test_python_keyword_field_names_basemodel() -> None:
170175
"""Handles Python reserved keywords as field names for BaseModel."""
171176

@@ -204,10 +209,10 @@ def test_python_keyword_field_names_basemodel() -> None:
204209
}
205210
}
206211

207-
files: dict[Path, StringIO] = {}
212+
files: dict[Path, UnclosableStringIO] = {}
208213

209-
def file_opener(path: Path) -> StringIO:
210-
buf = StringIO()
214+
def file_opener(path: Path) -> UnclosableStringIO:
215+
buf = UnclosableStringIO()
211216
files[path] = buf
212217
return buf
213218

@@ -271,10 +276,10 @@ def test_python_keyword_field_names_typeddict() -> None:
271276
}
272277
}
273278

274-
files: dict[Path, StringIO] = {}
279+
files: dict[Path, UnclosableStringIO] = {}
275280

276-
def file_opener(path: Path) -> StringIO:
277-
buf = StringIO()
281+
def file_opener(path: Path) -> UnclosableStringIO:
282+
buf = UnclosableStringIO()
278283
files[path] = buf
279284
return buf
280285

0 commit comments

Comments
 (0)