{{ message }}
gh-139322: Remove redundant test_os.Win32ErrorTests#139477
Merged
Merged
Conversation
test_os OSErrorTests already covers the OSError class and is more complete than Win32ErrorTests.
test_os.Win32ErrorTests
Member
Author
| filename = os_helper.TESTFN | ||
| self.addCleanup(os_helper.unlink, filename) | ||
| create_file(filename) | ||
| self.assertRaises(OSError, os.mkdir, filename) |
Member
There was a problem hiding this comment.
Maybe test for more concrete OSError subclass? It is FileExistsError on Linux.
Also, NotADirectoryError for os.path.join(filename, 'subdir') and FileNotFoundError for os.path.join(filename, 'subdir') if filename does not exist,
Member
Author
There was a problem hiding this comment.
Let me try with FileExistsError.
serhiy-storchaka
approved these changes
Oct 1, 2025
serhiy-storchaka
left a comment
Member
There was a problem hiding this comment.
LGTM. 👍
But if we add a new test, I suggest to add also tests for os.path.join(filename, 'subdir'), before and after creation of filename. AFAIK, this is not tested.
Member
Author
|
Merged. I added more tests on chdir() errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

test_os OSErrorTests already covers the OSError class and is more complete than Win32ErrorTests.