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

Skip to content

Commit c8b396c

Browse files
committed
Add test.
1 parent 23b4e73 commit c8b396c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/matplotlib/cbook/deprecation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ def func(good_name): ...
285285
signature = inspect.signature(func)
286286
assert old not in signature.parameters, (
287287
f"Matplotlib internal error: {old!r} cannot be a parameter for "
288-
"{func.__name__}()")
288+
f"{func.__name__}()")
289289
assert new in signature.parameters, (
290290
f"Matplotlib internal error: {new!r} must be a parameter for "
291-
"{func.__name__}()")
291+
f"{func.__name__}()")
292292

293293
@functools.wraps(func)
294294
def wrapper(*args, **kwargs):

lib/matplotlib/tests/test_axes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,17 @@ def test_hist2d_transpose():
16931693
ax.hist2d(x, y, bins=10, rasterized=True)
16941694

16951695

1696+
def test_hist2d_density_normed():
1697+
x, y = np.random.random((2, 100))
1698+
ax = plt.figure().subplots()
1699+
for obj in [ax, plt]:
1700+
obj.hist2d(x, y, density=True)
1701+
with pytest.warns(MatplotlibDeprecationWarning):
1702+
obj.hist2d(x, y, normed=True)
1703+
with pytest.warns(MatplotlibDeprecationWarning):
1704+
obj.hist2d(x, y, density=True, normed=True)
1705+
1706+
16961707
class TestScatter(object):
16971708
@image_comparison(baseline_images=['scatter'],
16981709
style='mpl20', remove_text=True)

0 commit comments

Comments
 (0)