-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-139322: Remove redundant test_os.Win32ErrorTests
#139477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
test_os OSErrorTests already covers the OSError class and is more complete than Win32ErrorTests.
test_os.Win32ErrorTests
Lib/test/test_os/test_os.py
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me try with FileExistsError.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Merged. I added more tests on chdir() errors. |
|
test_os OSErrorTests already covers the OSError class and is more complete than Win32ErrorTests.