8000 gh-116622: Make test_unzip_zipfile recognize Android error message format by mhsmith · Pull Request #124462 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-116622: Make test_unzip_zipfile recognize Android error message format #124462

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

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace regex with a simple list of strings
  • Loading branch information
mhsmith committed Sep 25, 2024
commit 54fcccf46f5a7a250dae3cdfb5bda603fa1936e1
6 changes: 4 additions & 2 deletions Lib/test/test_shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import pathlib
import subprocess
import random
import re
import string
import contextlib
import io
Expand Down Expand Up @@ -1910,7 +1909,10 @@ def test_unzip_zipfile(self):
subprocess.check_output(zip_cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as exc:
details = exc.output.decode(errors="replace")
if re.search(r'(unrecognized|invalid) option(:| --) t', details):
if any(message in details for message in [
'unrecognized option: t', # Info-ZIP
'invalid option -- t', # Android
]):
self.skipTest("unzip doesn't support -t")
msg = "{}\n\n**Unzip Output**\n{}"
self.fail(msg.format(exc, details))
Expand Down
Loading
0