Skip to content

Commit 4756455

Browse files
committed
Comments
1 parent f674811 commit 4756455

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/builtin/drawing/test_plot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def test_plot(str_expr, msgs, str_expected, fail_msg):
210210
# TODO: check_structure is a little fragile and a little hard to debug. Imrovements:
211211
# some indication of where in the structure the error is occurring - e.g. tree coordinates?
212212
#
213-
#
214213

215214

216215
def check_structure(result, expected):
@@ -223,10 +222,15 @@ def msg(s):
223222
pos = getattr(getattr(expected, "location", None), "start_pos", None)
224223
return f"in str_expected at pos {pos or '?'}: {s}"
225224

225+
# do the heads match?
226226
assert result.get_head() == expected.get_head(), msg("heads must match")
227+
228+
# do they either both or neither have elements?
227229
assert hasattr(result, "elements") == hasattr(expected, "elements"), msg(
228-
"either both or none must have elements"
230+
"either both or neither must have elements"
229231
)
232+
233+
# do they match?
230234
if hasattr(expected, "elements"):
231235
for i, e in enumerate(expected.elements):
232236
assert len(result.elements) > i, msg("result has too few elements")

0 commit comments

Comments
 (0)