Skip to content

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

Merged
barneygale merged 4 commits into
python:mainfrom
barneygale:remove-flavour-tests
Apr 9, 2023
Merged

GH-103379: Fix up old tests for pathlib.PurePath._parse_path#103380
barneygale merged 4 commits into
python:mainfrom
barneygale:remove-flavour-tests

Conversation

@barneygale

@barneygalebarneygale commented Apr 8, 2023

Copy link
Copy Markdown
Contributor

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.

@terryjreedyterryjreedy left a comment

Copy link
Copy Markdown
Member

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.

Comment threadLib/test/test_pathlib.py
Comment threadLib/test/test_pathlib.py Outdated
@terryjreedyterryjreedy changed the title GH-103379: Fix up old tests for pathlib.PurePath._parse_parts()GH-103379: Fix up old tests for pathlib.PurePath._parse_pathApr 8, 2023

@terryjreedyterryjreedy left a comment

Copy link
Copy Markdown
Member

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.

Comment threadLib/test/test_pathlib.py
barneygaleand others added 2 commits April 9, 2023 03:22
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

@AlexWaygoodAlexWaygood left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dirtopic-pathlib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@barneygale@terryjreedy@AlexWaygood@bedevere-bot