Skip to content

Commit 8861451

Browse files
committed
black
1 parent c8d35b4 commit 8861451

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

packages/python/plotly/_plotly_utils/tests/validators/test_color_validator.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,14 @@ def test_acceptance_aok(val, validator_aok):
136136
# Numpy v2 has a StrDType but we don't want to convert it yet.
137137
# Change this test if you add support for it.
138138
def test_acceptance_aok_base64_array(validator_aok):
139-
val = b64(np.array(['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure']))
139+
val = b64(np.array(["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure"]))
140140
coerce_val = validator_aok.validate_coerce(val)
141-
assert coerce_val[0] == 'aliceblue'
142-
assert coerce_val[1] == 'antiquewhite'
143-
assert coerce_val[2] == 'aqua'
144-
assert coerce_val[3] == 'aquamarine'
145-
assert coerce_val[4] == 'azure'
141+
assert coerce_val[0] == "aliceblue"
142+
assert coerce_val[1] == "antiquewhite"
143+
assert coerce_val[2] == "aqua"
144+
assert coerce_val[3] == "aquamarine"
145+
assert coerce_val[4] == "azure"
146+
146147

147148
@pytest.mark.parametrize(
148149
"val",

packages/python/plotly/_plotly_utils/tests/validators/test_colorlist_validator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ def test_acceptance_aok(val, validator):
4949
assert isinstance(coerce_val, list)
5050
assert validator.present(coerce_val) == tuple(val)
5151

52+
5253
# Test that it doesn't use a base64 array
5354
# Numpy v2 has a StrDType but we don't want to convert it yet.
5455
# Change this test if you add support for it.
5556
def test_acceptance_b64_aok(validator):
5657
val = b64(np.array(["red", "rgb(255, 0, 0)"]))
5758
coerce_val = validator.validate_coerce(val)
5859
assert coerce_val[0] == "red"
59-
assert coerce_val[1] == "rgb(255, 0, 0)"
60+
assert coerce_val[1] == "rgb(255, 0, 0)"

packages/python/plotly/_plotly_utils/tests/validators/test_enumerated_validator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ def test_acceptance_aok(val, validator_aok):
9494
else:
9595
assert coerce_val == val
9696

97+
9798
# Test base64 array
9899
def test_aok_base64_array(validator_aok):
99100
val = b64(np.array([1, 2, 3], dtype="int64"))
100101
coerce_val = validator_aok.validate_coerce(val)
101102
assert coerce_val["bdata"] == "AQID"
102103
assert coerce_val["dtype"] == "i1"
103104

105+
104106
# ### Rejection by value ###
105107
@pytest.mark.parametrize("val", [True, 0, 1, 23, np.inf, set()])
106108
def test_rejection_by_value_aok(val, validator_aok):

packages/python/plotly/_plotly_utils/tests/validators/test_integer_validator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def test_acceptance_aok_list(val, validator_aok):
115115
# Test base64 encoded arrays with array_ok=True
116116
INT_BASE64_TEST_CASES = [
117117
# Note: we decided not to support int64 in plotly.js,
118-
# so the the max / min value are limited to int32 and the
118+
# so the the max / min value are limited to int32 and the
119119
# dtype is cast to int32 in the output
120120
(
121121
b64(np.array([-900000000, 900000000, 3], dtype="int64")),
@@ -150,6 +150,8 @@ def test_acceptance_aok_list(val, validator_aok):
150150
{"bdata": "fwID", "dtype": "u1"},
151151
),
152152
]
153+
154+
153155
@pytest.mark.parametrize("val, expected", INT_BASE64_TEST_CASES)
154156
def test_acceptance_aok_base64(val, expected, validator_aok):
155157
assert np.array_equal(validator_aok.validate_coerce(val), expected)

packages/python/plotly/_plotly_utils/tests/validators/test_string_validator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ def test_acceptance_aok_list(val, validator_aok):
151151
# Numpy v2 has a StrDType but we don't want to convert it yet.
152152
# Change this test if you add support for it.
153153
def test_aok_base64_array(validator_aok):
154-
val = b64(np.array(['a', 'b', 'c'], dtype=np.dtypes.StrDType))
154+
val = b64(np.array(["a", "b", "c"], dtype=np.dtypes.StrDType))
155155
coerce_val = validator_aok.validate_coerce(val)
156-
assert coerce_val[0] == 'a'
157-
assert coerce_val[1] == 'b'
158-
assert coerce_val[2] == 'c'
156+
assert coerce_val[0] == "a"
157+
assert coerce_val[1] == "b"
158+
assert coerce_val[2] == "c"
159159

160160

161161
# ### Rejection by type ###

0 commit comments

Comments
 (0)