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(
1356
1356
1357
1357
Returns
1358
1358
------
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.
1361
1362
1362
1363
Raises
1363
1364
------
Original file line number Diff line number Diff line change @@ -314,21 +314,21 @@ class InvalidBuffer:
314
314
pass
315
315
316
316
parser = all_parsers
317
- msg = "Invalid file path or buffer object type "
317
+ msg = "Expected file path name or file-like object"
318
318
319
- with pytest .raises (ValueError , match = msg ):
319
+ with pytest .raises (TypeError , match = msg ):
320
320
parser .read_csv (InvalidBuffer ())
321
321
322
322
323
323
def test_invalid_file_buffer_mock (all_parsers ):
324
324
# see gh-15337
325
325
parser = all_parsers
326
- msg = "Invalid file path or buffer object type "
326
+ msg = "Expected file path name or file-like object"
327
327
328
328
class Foo :
329
329
pass
330
330
331
- with pytest .raises (ValueError , match = msg ):
331
+ with pytest .raises (TypeError , match = msg ):
332
332
parser .read_csv (Foo ())
333
333
334
334
You can’t perform that action at this time.
0 commit comments