diff --git a/tests/test_categorical.py b/tests/test_categorical.py index 88844cf5dd..6b746aa7ef 100644 --- a/tests/test_categorical.py +++ b/tests/test_categorical.py @@ -3125,10 +3125,14 @@ def test_invalid_kind(self, long_df): with pytest.raises(ValueError, match="Invalid `kind`: 'wrong'"): catplot(long_df, kind="wrong") - def test_no_legend_with_auto(self): + def test_legend_with_auto(self): + + g1 = catplot(self.df, x="g", y="y", hue="g", legend='auto') + assert g1._legend is None + + g2 = catplot(self.df, x="g", y="y", hue="g", legend=True) + assert g2._legend is not None - g = catplot(self.df, x="g", y="y", hue="g", legend='auto') - assert g._legend is None class TestBeeswarm: