From 9f2e75d4a6e235cc0f6dcf3882577d704edbec93 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Tue, 24 Mar 2026 23:51:34 -0700 Subject: [PATCH] test: implement stacked bar regression test Replace the skipped test_bar_stack() placeholder with a real regression test that verifies both bar and area stacking behavior across a 2x2 subplot grid (stacked vs unstacked for each type). Fixes #642 --- ultraplot/tests/test_1dplots.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ultraplot/tests/test_1dplots.py b/ultraplot/tests/test_1dplots.py index d63256a52..a1efe9d8c 100644 --- a/ultraplot/tests/test_1dplots.py +++ b/ultraplot/tests/test_1dplots.py @@ -116,13 +116,19 @@ def test_column_iteration(rng): return fig -@pytest.mark.skip("TODO") @pytest.mark.mpl_image_compare -def test_bar_stack(): +def test_bar_stack(rng): """ Test bar and area stacking. """ - # TODO: Add test here + fig, axs = uplt.subplots(ncols=2, nrows=2) + x = np.arange(5) + y = rng.random((5, 3)) + axs[0].bar(x, y, stack=False) + axs[1].bar(x, y, stack=True) + axs[2].area(x, y, stack=False) + axs[3].area(x, y, stack=True) + return fig @pytest.mark.mpl_image_compare