Skip to content

Commit 476e31a

Browse files
committed
Apply suggestions from code review
1 parent 6b52229 commit 476e31a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testing/test_pathlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,13 @@ def test_scandir_with_non_existent_directory() -> None:
581581
def test_scandir_handles_os_error() -> None:
582582
# Create a mock entry that will raise an OSError when is_file is called
583583
mock_entry = unittest.mock.MagicMock()
584-
mock_entry.is_file.side_effect = OSError("Permission denied")
584+
mock_entry.is_file.side_effect = OSError("some permission error")
585585
# Mock os.scandir to return an iterator with our mock entry
586586
with unittest.mock.patch("os.scandir") as mock_scandir:
587587
mock_scandir.return_value.__enter__.return_value = [mock_entry]
588588
# Call the scandir function with a path
589589
# We expect an OSError to be raised here
590-
with pytest.raises(OSError, match="Permission denied"):
590+
with pytest.raises(OSError, match="some permission error"):
591591
scandir("/fake/path")
592592
# Verify that the is_file method was called on the mock entry
593593
mock_entry.is_file.assert_called_once()

0 commit comments

Comments
 (0)