Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5a7037

Browse files
authored
gh-93096: fixtest_mimetypes.test_invocation_error tests on iOS ARM64 (#132266)
1 parent0e4cf9c commitf5a7037

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎Lib/mimetypes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def _main(args=None):
706706
ifguess:
707707
returnf"type:{guess} encoding:{encoding}"
708708
sys.exit(f"error: media type unknown for{gtype}")
709-
returnparser.format_help()
709+
returnhelp_text
710710

711711

712712
if__name__=='__main__':

‎Lib/test/test_mimetypes.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ def test_parse_args(self):
417417
self.assertFalse(args.lenient)
418418
self.assertEqual(args.type, ["foo.pic"])
419419

420-
421420
deftest_invocation(self):
422421
forcommand,expectedin [
423422
("-l -e image/jpg",".jpg"),
@@ -426,14 +425,14 @@ def test_invocation(self):
426425
]:
427426
self.assertEqual(mimetypes._main(shlex.split(command)),expected)
428427

429-
430428
deftest_invocation_error(self):
431429
forcommand,expectedin [
432430
("-e image/jpg","error: unknown type image/jpg"),
433-
("foo.pic","error: media type unknown for foo.pic"),
431+
("foo.bar_ext","error: media type unknown for foo.bar_ext"),
434432
]:
435-
withself.assertRaisesRegex(SystemExit,expected):
436-
mimetypes._main(shlex.split(command))
433+
withself.subTest(command=command):
434+
withself.assertRaisesRegex(SystemExit,expected):
435+
mimetypes._main(shlex.split(command))
437436

438437

439438
if__name__=="__main__":

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp