Skip to content

Commit 9a5ca28

Browse files
committed
fix list.list
1 parent e807ba8 commit 9a5ca28

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

evalml/tests/model_understanding_tests/prediction_explanations_tests/test_force_plots.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import warnings
21
from itertools import product
32
from unittest.mock import patch
43

@@ -80,7 +79,7 @@ def test_force_plot_binary(
8079
else:
8180
# Code chunk to test where initjs is called if jupyter is recognized
8281
jupyter_check.return_value = False
83-
with warnings.catch_warnings(record=True) as graph_valid:
82+
with pytest.warns(None) as graph_valid:
8483
results = graph_force_plot(
8584
pipeline,
8685
rows_to_explain=rows_to_explain,
@@ -89,11 +88,11 @@ def test_force_plot_binary(
8988
matplotlib=False,
9089
)
9190
assert not initjs.called
92-
warnings_deprecated = set([str(gv) for gv in graph_valid.list])
93-
assert all(["DeprecationWarning" in w for w in warnings_deprecated])
91+
warnings = set([str(gv) for gv in graph_valid])
92+
assert all(["DeprecationWarning" in w for w in warnings])
9493

9594
jupyter_check.return_value = True
96-
with warnings.catch_warnings(record=True) as graph_valid:
95+
with pytest.warns(None) as graph_valid:
9796
results = graph_force_plot(
9897
pipeline,
9998
rows_to_explain=rows_to_explain,
@@ -102,8 +101,8 @@ def test_force_plot_binary(
102101
matplotlib=False,
103102
)
104103
assert initjs.called
105-
warnings_deprecated = set([str(gv) for gv in graph_valid.list])
106-
assert all(["DeprecationWarning" in w for w in warnings_deprecated])
104+
warnings = set([str(gv) for gv in graph_valid])
105+
assert all(["DeprecationWarning" in w for w in warnings])
107106

108107
# Should have a result per row to explain.
109108
assert len(results) == len(rows_to_explain)

0 commit comments

Comments
 (0)