File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1356,8 +1356,9 @@ def iterdir(
13561356
13571357 Returns
13581358 ------
1359- pathlib.Path or pathlib.PurePosixPath
1360- File paths within the directory.
1359+ list of str or Path, BaseBuffer
1360+ If `path` is a file-like object, returns it directly.
1361+ Otherwise, returns list of file paths in the directory.
13611362
13621363 Raises
13631364 ------
Original file line number Diff line number Diff line change @@ -314,21 +314,21 @@ class InvalidBuffer:
314314 pass
315315
316316 parser = all_parsers
317- msg = "Invalid file path or buffer object type "
317+ msg = "Expected file path name or file-like object"
318318
319- with pytest .raises (ValueError , match = msg ):
319+ with pytest .raises (TypeError , match = msg ):
320320 parser .read_csv (InvalidBuffer ())
321321
322322
323323def test_invalid_file_buffer_mock (all_parsers ):
324324 # see gh-15337
325325 parser = all_parsers
326- msg = "Invalid file path or buffer object type "
326+ msg = "Expected file path name or file-like object"
327327
328328 class Foo :
329329 pass
330330
331- with pytest .raises (ValueError , match = msg ):
331+ with pytest .raises (TypeError , match = msg ):
332332 parser .read_csv (Foo ())
333333
334334
You can’t perform that action at this time.
0 commit comments