GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-139322: Create test_os package by vstinner · Pull Request #139453 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Sep 30, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • 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.
  • Issue: Tests: move test_posix.py and test_os.py into a new test_os package #139322

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-139322: Create test_os package
491cb89
* 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.
@bedevere-app bedevere-app Bot added the awaiting core review label Sep 30, 2025
@vstinner vstinner added skip news and removed awaiting core review labels Sep 30, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Sep 30, 2025
Tests: move test_posix.py and test_os.py into a new test_os package #139322
Closed
@vstinner

vstinner commented Sep 30, 2025

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka reviewed Sep 30, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

Were is test_windows?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
Add missing files
852e6a1
@vstinner

vstinner commented Oct 1, 2025

Copy link
Copy Markdown
Member Author

Were is test_windows?

Ooops, I forgot git add :-) Fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits October 1, 2025 09:01
@vstinner
Remove unused imports
5bc5f57
@vstinner
Add test_os package to TESTSUBDIRS
f3dcf72
@vstinner
vstinner requested review from AA-Turner, emmatyping and erlend-aasland as code owners October 1, 2025 14:07
serhiy-storchaka
serhiy-storchaka reviewed Oct 1, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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. 👍

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_os/test_windows.py
from .utils import create_file


class Win32ErrorTests(unittest.TestCase):

@serhiy-storchaka serhiy-storchaka Oct 1, 2025

Copy link
Copy Markdown
Member

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka
serhiy-storchaka approved these changes Oct 1, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added the awaiting merge label Oct 1, 2025
@vstinner
vstinner merged commit 0158890 into python:main Oct 1, 2025
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner deleted the test_os_package2 branch October 1, 2025 14:42
@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 1, 2025
@vstinner

vstinner commented Oct 1, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Oct 1, 2025
gh-139322: Create test_os package #139323
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vstinner @serhiy-storchaka
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.