Skip to content

Commit

Permalink
Fix colour parsing test.
Browse files Browse the repository at this point in the history
Ensure contents of lists are floats rather than NumPy scalars.
  • Loading branch information
bcbnz committed Jan 26, 2025
1 parent 437502d commit db80963
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def test_rgb(self):

# Check they are accepted. The parser always returns colors as tuples.
for color in colors:
list_c = list(color)
tuple_c = tuple(color)
list_c = color.tolist()
tuple_c = tuple(list_c)
_config.read_kwargs(figure_background=str(list_c[:-1]))
assert _config["pgfutils"].getcolor("figure_background") == tuple_c
_config.read_kwargs(axes_background=str(tuple_c[:-1]))
Expand Down Expand Up @@ -123,8 +123,8 @@ def test_rgba(self):

# Check they are accepted. The parser always returns colors as tuples.
for color in colors:
list_c = list(color)
tuple_c = tuple(color)
list_c = color.tolist()
tuple_c = tuple(list_c)
_config.read_kwargs(figure_background=str(list_c))
assert _config["pgfutils"].getcolor("figure_background") == tuple_c
_config.read_kwargs(axes_background=str(tuple_c))
Expand Down

0 comments on commit db80963

Please sign in to comment.