]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116622: Make test_unzip_zipfile recognize Android error message format (#124462)
authorMalcolm Smith <smith@chaquo.com>
Wed, 25 Sep 2024 14:02:18 +0000 (15:02 +0100)
committerGitHub <noreply@github.com>
Wed, 25 Sep 2024 14:02:18 +0000 (07:02 -0700)
Make test_unzip_zipfile recognize Android error message format

Lib/test/test_shutil.py

index 80e1d73b6b2aab4714122ab09bb313c5fce816e9..37e54d23b22516c926803b4fae2379177c793339 100644 (file)
@@ -1909,7 +1909,10 @@ class TestArchives(BaseTest, unittest.TestCase):
                 subprocess.check_output(zip_cmd, stderr=subprocess.STDOUT)
             except subprocess.CalledProcessError as exc:
                 details = exc.output.decode(errors="replace")
-                if 'unrecognized option: t' in details:
+                if any(message in details for message in [
+                    'unrecognized option: t',  # BusyBox
+                    'invalid option -- t',  # Android
+                ]):
                     self.skipTest("unzip doesn't support -t")
                 msg = "{}\n\n**Unzip Output**\n{}"
                 self.fail(msg.format(exc, details))