Skip to content

Commit

Permalink
add pytest warning capture for hist
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamOrmondroyd committed Oct 3, 2023
1 parent a5f69cb commit 9ba5202
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ def test_plot_logscale(kind):
@pytest.mark.parametrize('r', [None, (1e-5, 1)])
def test_plot_logscale_hist_kwargs(k, b, r):
ns = read_chains('./tests/example_data/pc')
axes = ns[['x2']].plot_1d(kind=k, logx=['x2'], bins=b, range=r)
with pytest.warns(UserWarning) if k == 'hist' else nullcontext():
axes = ns[['x2']].plot_1d(kind=k, logx=['x2'], bins=b, range=r)
ax = axes.loc['x2']
assert ax.get_xscale() == 'log'
arg = np.argmax([p.get_height() for p in ax.patches])
Expand Down

0 comments on commit 9ba5202

Please sign in to comment.