Skip to content

Commit

Permalink
fix list.list
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelFu512 committed May 22, 2024
1 parent e807ba8 commit 9a5ca28
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from itertools import product
from unittest.mock import patch

Expand Down Expand Up @@ -80,7 +79,7 @@ def test_force_plot_binary(
else:
# Code chunk to test where initjs is called if jupyter is recognized
jupyter_check.return_value = False
with warnings.catch_warnings(record=True) as graph_valid:
with pytest.warns(None) as graph_valid:
results = graph_force_plot(
pipeline,
rows_to_explain=rows_to_explain,
Expand All @@ -89,11 +88,11 @@ def test_force_plot_binary(
matplotlib=False,
)
assert not initjs.called
warnings_deprecated = set([str(gv) for gv in graph_valid.list])
assert all(["DeprecationWarning" in w for w in warnings_deprecated])
warnings = set([str(gv) for gv in graph_valid])

Check warning on line 91 in evalml/tests/model_understanding_tests/prediction_explanations_tests/test_force_plots.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/model_understanding_tests/prediction_explanations_tests/test_force_plots.py#L91

Added line #L91 was not covered by tests
assert all(["DeprecationWarning" in w for w in warnings])

jupyter_check.return_value = True
with warnings.catch_warnings(record=True) as graph_valid:
with pytest.warns(None) as graph_valid:
results = graph_force_plot(
pipeline,
rows_to_explain=rows_to_explain,
Expand All @@ -102,8 +101,8 @@ def test_force_plot_binary(
matplotlib=False,
)
assert initjs.called
warnings_deprecated = set([str(gv) for gv in graph_valid.list])
assert all(["DeprecationWarning" in w for w in warnings_deprecated])
warnings = set([str(gv) for gv in graph_valid])

Check warning on line 104 in evalml/tests/model_understanding_tests/prediction_explanations_tests/test_force_plots.py

View check run for this annotation

Codecov / codecov/patch

evalml/tests/model_understanding_tests/prediction_explanations_tests/test_force_plots.py#L104

Added line #L104 was not covered by tests
assert all(["DeprecationWarning" in w for w in warnings])

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

0 comments on commit 9a5ca28

Please sign in to comment.