Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 30, 2025

  • Move test_posix.py and test_os.py to Lib/test/test_os/
  • Split Windows specific test cases to a new test_windows.py file.

* Move test_posix.py and test_os.py to Lib/test/test_os/
* Split Windows specific test cases to a new test_windows.py file.
@vstinner
Copy link
Member Author

@serhiy-storchaka: Here is a simpler approach which only creates test_windows.py for now.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were is test_windows?

@vstinner
Copy link
Member Author

vstinner commented Oct 1, 2025

Were is test_windows?

Ooops, I forgot git add :-) Fixed.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

Win32ErrorTests may be removed if all its tests are duplicated in other places for all platforms.

from .utils import create_file


class Win32ErrorTests(unittest.TestCase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, these tests were for WindowsError. But now OSError is raised on all platforms. These tests are no longer Windows specific, and most likely are duplicated in other parts.

Please check that all these functions are already tested with non-existing file (and mkdir() with an existing file). Then they can be deleted.

@vstinner vstinner merged commit 0158890 into python:main Oct 1, 2025
53 checks passed
@vstinner vstinner deleted the test_os_package2 branch October 1, 2025 14:42
@vstinner
Copy link
Member Author

vstinner commented Oct 1, 2025

Merged, thanks for the review.

Win32ErrorTests may be removed if all its tests are duplicated in other places for all platforms.

Good catch! I created #139477 to remove Win32ErrorTests. I prefer to remove the class in a separated change, rather than removing it in the middle of this refactoring (create test_os package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants