Skip to content

Commit

Permalink
set use_cdn=False in notebook tests (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
imatiach-msft committed Jul 8, 2020
1 parent 2e1e113 commit a6b72e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ def append_scrapbook_commands(input_nb_path, output_nb_path, scrap_specs):
source = "sb.glue(\"{0}\", {1})".format(k, v)
scrapbook_cells.append(nbf.v4.new_code_cell(source=source))

# Don't use CDN when running notebook tests
for cell in notebook['cells']:
if cell.cell_type == 'code' and "ExplanationDashboard(" in cell.source:
if "ExplanationDashboard(global_explanation, model, datasetX=x_test)" in cell.source:
cell.source = cell.source.replace("datasetX=x_test)", "datasetX=x_test, use_cdn=False)")
else:
raise Exception("ExplanationDashboard added in new format and could not be replaced. "
"Please replace code in tests to use_cdn in test_notebooks")
# Append the cells to the notebook
[notebook['cells'].append(c) for c in scrapbook_cells]

Expand Down

0 comments on commit a6b72e5

Please sign in to comment.