Skip to content

Commit 2f6a186

Browse files
committed
update for python 3.11 and later
1 parent ab92c7d commit 2f6a186

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/python/plotly/plotly/tests/test_core/test_errors/test_dict_path_errors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import plotly.graph_objects as go
22
from _plotly_utils.exceptions import PlotlyKeyError
33
import pytest
4+
import sys
45

56

67
def error_substr(s, r):
@@ -400,9 +401,11 @@ def test_described_subscript_error_on_type_error(some_fig):
400401
except ValueError as e:
401402
raised = True
402403
print(e.args[0])
404+
# Error is different in Python 3.11 and later
405+
error_addition_py_311 = ", not 'str'" if sys.version_info >= (3, 11, 0) else ""
403406
e_substr = error_substr(
404407
e.args[0],
405-
"""string indices must be integers
408+
f"""string indices must be integers{error_addition_py_311}
406409
407410
Invalid value received for the 'plot_bgcolor' property of layout
408411

0 commit comments

Comments
 (0)