Skip to content

Commit 0cdf4be

Browse files
committed
Drop the quotes from the capture group in the type code regex
1 parent 7441b57 commit 0cdf4be

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎Lib/test/test_array.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ def test_typecodes_documented(self):
117117
# The type code table in the array.array docstring must list every
118118
# supported type code, and nothing else, and the minimum size it
119119
# gives for each of them must be one the implementation meets.
120-
row = re.compile(r"^ {4}('\w+') +\S.*? +(\d+)(?: \(see note\))?$")
120+
row = re.compile(r"^ {4}'(\w+)' +\S.*? +(\d+)(?: \(see note\))?$")
121121
documented = {}
122122
for line in array.array.__doc__.splitlines():
123123
match = row.match(line)
124124
if match is not None:
125-
documented[match.group(1).strip("'")] = int(match.group(2))
125+
documented[match.group(1)] = int(match.group(2))
126+
126127
self.assertEqual(sorted(documented), sorted(array.typecodes))
127128
for typecode, minimum_size in documented.items():
128129
with self.subTest(typecode=typecode):

0 commit comments

Comments
 (0)