-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Conversation
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.
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.
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.
pathlib.PurePath._parse_parts()
pathlib.PurePath._parse_path
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.
The calls with first and last args being flat tuples looks fine. This looks better to me than before.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
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.
Looks great to me -- thanks @barneygale!
Thank you both! |
…ythonGH-103380) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…ythonGH-103380) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
These tests now make assertions about the public
PurePath.drive
,root
andparts
attributes, rather than an internal method. They're moved out of the_BaseFlavourTest
,PosixFlavourTest
andNTFlavourTest
classes, which are removed.