Skip to content

Commit

Permalink
added test for empty kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
CDonnerer committed Feb 8, 2021
1 parent cd0227b commit d308914
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/shellplot/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def array_split(x, y, kwargs):
label = kwargs.get("label", [])
if kwargs.get("label") is not None:
kwargs.pop("label")

for x, y in zip(x, y):
val_kwargs = copy.deepcopy(kwargs)
if len(label) != 0:
Expand Down
4 changes: 4 additions & 0 deletions tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def test_array_split_arrays(x, y, expected_xy):
{"label": ["a"]},
[{"label": "a"}, {}]
),
(
{},
[{}, {}]
),
],
)
def test_array_split_label_kwargs(kwargs, expected_kwargs):
Expand Down

0 comments on commit d308914

Please sign in to comment.