| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
This PR extends CPython’s zipapp test suite by adding a new subprocess-driven test class that exercises the real python -m zipapp command-line interface, complementing the existing in-process zipapp.main() CLI tests.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Lib/test/test_zipapp.py | Adds subprocess-based CLI tests for python -m zipapp and related helpers. |
| Misc/NEWS.d/next/Tests/2026-05-21-22-06-07.gh-issue-131178.zipapp_cli.rst | Notes the addition of subprocess-based zipapp CLI tests. |
Lib/test/test_zipapp.py:561
def test_copy_archive_inplace_fails(self):
original = self._make_archive()
result = self._run(str(original), '-o', str(original))
self.assertNotEqual(result.returncode, 0)
Lib/test/test_zipapp.py:567
def test_copy_archive_change_main_fails(self):
original = self._make_archive()
target = self.tmpdir / 'copy.pyz'
result = self._run(str(original), '-o', str(target), '-m', 'foo:bar')
self.assertNotEqual(result.returncode, 0)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| def _run(self, *args): | ||
| return subprocess.run( | ||
| [sys.executable, '-m', 'zipapp', *args], | ||
| capture_output=True, | ||
| ) |
| def test_info_nonexistent_file(self): | ||
| target = self.tmpdir / 'nonexistent.pyz' | ||
| result = self._run(str(target), '--info') | ||
| self.assertNotEqual(result.returncode, 0) |
| @requires_subprocess() | ||
| class CommandLineTest(unittest.TestCase): | ||
| """Test the ``python -m zipapp`` command-line interface via subprocess.""" |
| Back | FazBrowse Home | New Git URL |
Add CommandLineTest class with subprocess-based tests for python -m zipapp, covering: