diff --git a/lib/matplotlib/tests/test_datetime.py b/lib/matplotlib/tests/test_datetime.py index 104a649e1464..a77f853eb70c 100644 --- a/lib/matplotlib/tests/test_datetime.py +++ b/lib/matplotlib/tests/test_datetime.py @@ -224,8 +224,17 @@ def test_barh(self): @pytest.mark.xfail(reason="Test for boxplot not written yet") @mpl.style.context("default") def test_boxplot(self): - fig, ax = plt.subplots() - ax.boxplot(...) + data = [datetime.datetime(2023, 10, 5, 18, 52, 59), + datetime.datetime(2023, 10, 4, 18, 53, 0), + datetime.datetime(2023, 10, 3, 18, 53, 1), + datetime.datetime(2023, 10, 2, 18, 53, 2), + datetime.datetime(2023, 10, 1, 18, 53, 3)] + datums = np.array([datetime.datetime.toordinal(d) for d in data]) + plt.boxplot(datums, labels=['my data'], showfliers=True) + plt.xlabel('Datetime') + plt.ylabel('value') + plt.title('Boxplot of datetime data') + plt.show() @mpl.style.context("default") def test_broken_barh(self):