Skip to content
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

GH-103379: Fix up old tests for pathlib.PurePath._parse_path #103380

Merged
merged 4 commits into from
Apr 9, 2023

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Apr 8, 2023

These tests now make assertions about the public PurePath.drive, root and parts attributes, rather than an internal method. They're moved out of the _BaseFlavourTest, PosixFlavourTest and NTFlavourTest classes, which are removed.

These tests now make assertions about the public `PurePath.drive`, `root`
and `parts` attributes, rather than an internal method. They're moved out
of the `_BaseFlavourTest`, `PosixFlavourTest` and `NTFlavourTest` classes,
which are removed.
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

I have seen discussions of whether or not to write tests for private functions and am somewhat on the fence. Since you propose to merely change the existing tests, rather than delete them, and the change makes it clearer (to me) what is really being tested, I approve.

Lib/test/test_pathlib.py Show resolved Hide resolved
@terryjreedy terryjreedy changed the title GH-103379: Fix up old tests for pathlib.PurePath._parse_parts() GH-103379: Fix up old tests for pathlib.PurePath._parse_path Apr 8, 2023
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

The calls with first and last args being flat tuples looks fine. This looks better to me than before.

Lib/test/test_pathlib.py Outdated Show resolved Hide resolved
barneygale and others added 2 commits April 9, 2023 03:22
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Looks great to me -- thanks @barneygale!

@barneygale
Copy link
Contributor Author

Thank you both!

warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir topic-pathlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants