Skip to content

Port test changes from CPython - #165

Merged
jaraco merged 4 commits into
mainfrom
debt/port-cpython-test-changes
Oct 21, 2026
Merged

jaraco merged 4 commits into
mainfrom
debt/port-cpython-test-changes

Conversation

@jaraco

@jaraco jaraco commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Ports the changes made to zipfile.Path's tests in CPython since the
zipp 3.23 sync, in preparation for merging zipp 4.1.1 downstream.

Cherry-picked from CPython main:

Plus one commit of my own: TestCase.enterContext arrived in Python 3.11, so a shim lands in tests/compat/py310 for the Python 3.10 we still support.

Tests pass on 3.10 and 3.14.

🤖 Generated with Claude Code

LamentXU123 and others added 4 commits October 21, 2026 11:30
(cherry picked from commit 561212a03306cb2f246771e9c4748bec1dc41405)
Zipfile tests: close file objects

(cherry picked from commit 5cea8435943b4f9d22c89c80d86c2ba3b392c6f9)
Bring `zipfile.ZipFile` into alignment with other buffered file writers
like `GzipFile` and `TextIOWrapper` by emitting a `ResourceWarning` if
there is unwritten data and it is closed implicitly.

ZipFile should be closed either by using it as a context manager or
explicitly calling `.close()`.

(cherry picked from commit 5e0c502799f3324b8a0776cacd6a3af5b62879b5)
The tests ported from CPython rely on unittest.TestCase.enterContext,
added in Python 3.11.
@jaraco
jaraco merged commit 450ce6d into main Oct 21, 2026
36 checks passed
@jaraco
jaraco deleted the debt/port-cpython-test-changes branch October 21, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants