|
5 | 5 | import itertools |
6 | 6 | import pickle |
7 | 7 | import platform |
8 | | -import shlex |
9 | 8 | import subprocess |
10 | 9 | import sys |
11 | 10 | import unittest |
12 | | -from unittest import mock |
13 | 11 | from textwrap import dedent |
| 12 | +from unittest import mock |
14 | 13 |
|
15 | 14 | from test import support |
16 | 15 | from test.support import os_helper |
@@ -789,19 +788,19 @@ def test_arg_parsing(self): |
789 | 788 | # `platform.platform()` call. The parameters are two booleans for `aliased` |
790 | 789 | # and `terse`. |
791 | 790 | options = ( |
792 | | - ("--nonaliased", (False, False)), |
793 | | - ("nonaliased", (False, False)), |
794 | | - ("--terse", (True, True)), |
795 | | - ("terse", (True, True)), |
796 | | - ("nonaliased terse", (False, True)), |
797 | | - ("--nonaliased terse", (False, True)), |
798 | | - ("--terse nonaliased", (False, True)), |
| 791 | + (["--nonaliased"], (False, False)), |
| 792 | + (["nonaliased"], (False, False)), |
| 793 | + (["--terse"], (True, True)), |
| 794 | + (["terse"], (True, True)), |
| 795 | + (["nonaliased", "terse"], (False, True)), |
| 796 | + (["--nonaliased", "terse"], (False, True)), |
| 797 | + (["--terse", "nonaliased"], (False, True)), |
799 | 798 | ) |
800 | 799 |
|
801 | 800 | for flags, args in options: |
802 | | - with self.subTest(f"{flags}, {args}"): |
| 801 | + with self.subTest(flags=flags, args=args): |
803 | 802 | with mock.patch.object(platform, 'platform') as obj: |
804 | | - self.invoke_platform(*shlex.split(flags)) |
| 803 | + self.invoke_platform(*flags) |
805 | 804 | obj.assert_called_once_with(*args) |
806 | 805 |
|
807 | 806 | def test_help(self): |
|
0 commit comments