Uh oh!
There was an error while loading. Please reload this page.
gh-139322: Remove redundant test_os.Win32ErrorTests - #139477
Conversation
test_os OSErrorTests already covers the OSError class and is more complete than Win32ErrorTests.
test_os.Win32ErrorTestsvstinner
commented
Oct 1, 2025
| filename = os_helper.TESTFN | ||
| self.addCleanup(os_helper.unlink, filename) | ||
| create_file(filename) | ||
| self.assertRaises(OSError, os.mkdir, filename) |
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,
There was a problem hiding this comment.
Let me try with FileExistsError.
serhiy-storchaka
left a comment
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.
vstinner
commented
Oct 2, 2025
Merged. I added more tests on chdir() errors. |
bedevere-bot
commented
Oct 2, 2025
|
test_os OSErrorTests already covers the OSError class and is more complete than Win32ErrorTests.