| 2492 | |
| 2493 | |
| 2494 | def test_hist_timedelta_raises(): |
| 2495 | import numpy as np |
| 2496 | import matplotlib.pyplot as plt |
| 2497 | |
| 2498 | fig, ax = plt.subplots() |
| 2499 | |
| 2500 | arr_np = np.array([1, 2, 5, 7], dtype="timedelta64[D]") |
| 2501 | with pytest.raises(TypeError, match="does not currently support timedelta inputs"): |
| 2502 | ax.hist(arr_np) |
| 2503 | |
| 2504 | arr_py = [datetime.timedelta(seconds=i) for i in range(5)] |
| 2505 | with pytest.raises(TypeError, match="does not currently support timedelta inputs"): |
| 2506 | ax.hist(arr_py) |
| 2507 | |
| 2508 | |
| 2509 | @image_comparison(['hist_bar_empty.png'], remove_text=True, style='_classic_test') |