Skip to content

Commit 021a76a

Browse files
committed
ENH: include property name in artist AttributeError
1 parent c4510ca commit 021a76a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/matplotlib/artist.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,8 @@ def _update_props(self, props, errfmt):
12031203
func = getattr(self, f"set_{k}", None)
12041204
if not callable(func):
12051205
raise AttributeError(
1206-
errfmt.format(cls=type(self), prop_name=k))
1206+
errfmt.format(cls=type(self), prop_name=k),
1207+
name=k)
12071208
ret.append(func(v))
12081209
if ret:
12091210
self.pchanged()

‎lib/mpl_toolkits/mplot3d/tests/test_axes3d.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,8 +1501,9 @@ def test_calling_conventions(self):
15011501
ax.voxels(x, y)
15021502
# x, y, z are positional only - this passes them on as attributes of
15031503
# Poly3DCollection
1504-
with pytest.raises(AttributeError):
1504+
with pytest.raises(AttributeError) as exec_info:
15051505
ax.voxels(filled=filled, x=x, y=y, z=z)
1506+
assert exec_info.value.name == 'x'
15061507

15071508

15081509
def test_line3d_set_get_data_3d():

0 commit comments

Comments
 (0)