Skip to content

Catch normed warning in tests #10200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2930,9 +2930,9 @@ def test_hist_stacked_normed():
# make some data
d1 = np.linspace(1, 3, 20)
d2 = np.linspace(0, 10, 50)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.hist((d1, d2), stacked=True, normed=True)
fig, ax = plt.subplots()
with pytest.warns(UserWarning):
ax.hist((d1, d2), stacked=True, normed=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of catching the warning, why not stop using the deprecated 'normed' kwarg in the tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because although it's deprecated, it should still work until removed (and we should be testing that it still works)



@image_comparison(baseline_images=['hist_stacked_normed'], extensions=['png'])
Expand Down