File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+
169174def 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
You can’t perform that action at this time.
0 commit comments