Skip to content

Commit 9899bcd

Browse files
committed
refactor(test_docscrape): explicitly declare strict=True for testing zips
1 parent 64fbebb commit 9899bcd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numpydoc/tests/test_docscrape.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def test_extended_summary(doc):
187187
def test_parameters(doc):
188188
assert len(doc["Parameters"]) == 4
189189
names = [n for n, _, _ in doc["Parameters"]]
190-
assert all(a == b for a, b in zip(names, ["mean", "cov", "shape"]))
190+
assert all(a == b for a, b in zip(names, ["mean", "cov", "shape"], strict=True))
191191

192192
arg, arg_type, desc = doc["Parameters"][1]
193193
assert arg_type == "(N, N) ndarray"
@@ -242,7 +242,7 @@ def test_yields():
242242
("b", "int", "bananas."),
243243
("", "int", "unknowns."),
244244
]
245-
for (arg, arg_type, desc), (arg_, arg_type_, end) in zip(section, truth):
245+
for (arg, arg_type, desc), (arg_, arg_type_, end) in zip(section, truth, strict=True):
246246
assert arg == arg_
247247
assert arg_type == arg_type_
248248
assert desc[0].startswith("The number of")
@@ -253,7 +253,7 @@ def test_sent():
253253
section = doc_sent["Receives"]
254254
assert len(section) == 2
255255
truth = [("b", "int", "bananas."), ("c", "int", "oranges.")]
256-
for (arg, arg_type, desc), (arg_, arg_type_, end) in zip(section, truth):
256+
for (arg, arg_type, desc), (arg_, arg_type_, end) in zip(section, truth, strict=True):
257257
assert arg == arg_
258258
assert arg_type == arg_type_
259259
assert desc[0].startswith("The number of")
@@ -374,7 +374,7 @@ def line_by_line_compare(a, b, n_lines=None):
374374
a = [l.rstrip() for l in _strip_blank_lines(a).split("\n")][:n_lines]
375375
b = [l.rstrip() for l in _strip_blank_lines(b).split("\n")][:n_lines]
376376
assert len(a) == len(b)
377-
for ii, (aa, bb) in enumerate(zip(a, b)):
377+
for ii, (aa, bb) in enumerate(zip(a, b, strict=True)):
378378
assert aa == bb
379379

380380

0 commit comments

Comments
 (0)