-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Parametrize tests for pathlib.Path.copy()
#130614
Labels
Comments
I would like to work on it. If not taken |
Yes, Please go ahead :-) |
I've already made a start on this, but I'll stop making changes and put a PR up so that others can contribute. |
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Feb 27, 2025
…paths Add `test.test_pathlib.test_read`, which tests `ReadablePath` subclasses. Tests are run against `ReadableZipPath`, `ReadableLocalPath`, and `Path`. This test suite is mostly incomplete. Add `test.test_pathlib.test_write`, which tests `WritablePath` subclasses. Tests are run against `WritableZipPath`, `WritableLocalPath`, and `Path`. This test suite is mostly complete. Add `test.test_pathlib.support.zip_path`, which provides the `*ZipPath` classes mentioned above. It also provides a `ZipPathGround` class that's used by tests to make assertions about the contents of the zip file. Add `test.test_pathlib.support.local_path`, which provides the `*LocalPath` classes mentioned above. They're stripped-back versions of `pathlib.Path`, basically. It also provides `LocalPathGround` class that's used by tests to access the local filesystem.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Feb 27, 2025
…paths Add `test.test_pathlib.test_read`, which tests `ReadablePath` subclasses. Tests are run against `ReadableZipPath`, `ReadableLocalPath`, and `Path`. This test suite is mostly incomplete. Add `test.test_pathlib.test_write`, which tests `WritablePath` subclasses. Tests are run against `WritableZipPath`, `WritableLocalPath`, and `Path`. This test suite is mostly complete. Add `test.test_pathlib.support.zip_path`, which provides the `*ZipPath` classes mentioned above. It also provides a `ZipPathGround` class that's used by tests to make assertions about the contents of the zip file. Add `test.test_pathlib.support.local_path`, which provides the `*LocalPath` classes mentioned above. They're stripped-back versions of `pathlib.Path`, basically. It also provides `LocalPathGround` class that's used by tests to access the local filesystem.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 8, 2025
Test `pathlib.types._JoinablePath` in a dedicated test module. These tests cover `LexicalPath`, `PurePath` and `Path`, where `LexicalPath` is defined in a new `test.test_pathlib.support` package.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 8, 2025
…e()` In `pathlib.types._JoinablePath.with_name()`, retain any alternative path separator preceding the old name, rather stripping and replacing it with a primary separator. As a result, this method changes _only_ the name.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 8, 2025
…atch()` In `pathlib.types._JoinablePath.full_match()`, treat alternate path separators in the path and pattern as if they were primary separators. e.g. if the parser is `ntpath`, then `P(r'foo/bar\baz').full_match(r'*\*/*')` is true.
barneygale
added a commit
that referenced
this issue
Mar 9, 2025
…130990) In `pathlib.types._JoinablePath.with_name()`, retain any alternative path separator preceding the old name, rather stripping and replacing it with a primary separator. As a result, this method changes _only_ the name.
barneygale
added a commit
that referenced
this issue
Mar 9, 2025
#130991) In `pathlib.types._JoinablePath.full_match()`, treat alternate path separators in the path and pattern as if they were primary separators. e.g. if the parser is `ntpath`, then `P(r'foo/bar\baz').full_match(r'*\*/*')` is true.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 9, 2025
barneygale
added a commit
that referenced
this issue
Mar 9, 2025
Test `pathlib.types._JoinablePath` in a dedicated test module. These tests cover `LexicalPath`, `PurePath` and `Path`, where `LexicalPath` is defined in a new `test.test_pathlib.support` package.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 9, 2025
…ning Test Windows-flavoured `pathlib.types._JoinablePath` in a dedicated test module. These tests cover `LexicalWindowsPath`, `PureWindowsPath` and `WindowsPath`, where `LexicalWindowsPath` is a simple implementation of `_JoinablePath` for use in tests.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 9, 2025
Test Posix-flavoured `pathlib.types._JoinablePath` in a dedicated test module. These tests cover `LexicalPosixPath`, `PurePosixPath` and `PosixPath`, where `LexicalPosixPath` is a simple implementation of `_JoinablePath` for use in tests.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Mar 9, 2025
Test `pathlib.types._ReadablePath` in a dedicated test module. These tests cover `ReadableZipPath`, `ReadableLocalPath` and `Path`, where the former two classes are implementations of `_ReadablePath` for use in tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
We should be able to parametrize tests for pathlib's
ReadablePath.copy()
, e.g.:Path
toPath
Path
toWritableZipPath
ReadableZipPath
toPath
ReadableZipPath
toWritableZipPath
Unfortunately this breaks some deep assumptions in the existing test classes, so I think we should create new suites somewhere in
test.test_pathlib
.Linked PRs
pathlib
paths #130648with_name()
#130990full_match()
#130991The text was updated successfully, but these errors were encountered: