Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73daa7d

Browse files
committed
test: fix legend callback shape and alignment API in figureoptions
1 parent 61ff900 commit 73daa7d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def apply_callback(data):
288288
edgecolor=old_legend.legendPatch.get_edgecolor(),
289289
facecolor=old_legend.legendPatch.get_facecolor(),
290290
linewidth=old_legend.legendPatch.get_linewidth(),
291-
alignment=old_legend._alignment,
291+
alignment=old_legend.get_alignment(),
292292
prop=old_legend.prop,
293293
**bbox_to_anchor_kwargs,
294294
)

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ def fake_fedit(datalist, **kwargs):
254254
general[-1] = True
255255
payload = [general]
256256
if len(datalist) > 1:
257-
payload.append(list(datalist[1]))
257+
payload.append([curve[0] for curve in datalist[1]])
258258
if len(datalist) > 2:
259-
payload.append(list(datalist[2]))
259+
payload.append([mappable[0] for mappable in datalist[2]])
260260
kwargs["apply"](payload)
261261

262262
with mock.patch(
@@ -280,7 +280,7 @@ def fake_fedit(datalist, **kwargs):
280280
assert new_legend.borderaxespad == old_legend.borderaxespad
281281
assert new_legend.columnspacing == old_legend.columnspacing
282282
assert new_legend._mode == old_legend._mode
283-
assert new_legend._alignment == old_legend._alignment
283+
assert new_legend.get_alignment() == old_legend.get_alignment()
284284
assert new_legend.shadow == old_legend.shadow
285285
assert new_legend.get_frame_on() == old_legend.get_frame_on()
286286
assert new_legend.legendPatch.get_alpha() == pytest.approx(

0 commit comments

Comments
 (0)