Skip to content

Commit a5dcbf2

Browse files
committed
Convert shlex call to an array of flags
1 parent 1f230f2 commit a5dcbf2

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Lib/test/test_platform.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
import itertools
66
import pickle
77
import platform
8-
import shlex
98
import subprocess
109
import sys
1110
import unittest
12-
from unittest import mock
1311
from textwrap import dedent
12+
from unittest import mock
1413

1514
from test import support
1615
from test.support import os_helper
@@ -789,19 +788,19 @@ def test_arg_parsing(self):
789788
# `platform.platform()` call. The parameters are two booleans for `aliased`
790789
# and `terse`.
791790
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)),
799798
)
800799

801800
for flags, args in options:
802-
with self.subTest(f"{flags}, {args}"):
801+
with self.subTest(flags=flags, args=args):
803802
with mock.patch.object(platform, 'platform') as obj:
804-
self.invoke_platform(*shlex.split(flags))
803+
self.invoke_platform(*flags)
805804
obj.assert_called_once_with(*args)
806805

807806
def test_help(self):

0 commit comments

Comments
 (0)