diff --git a/test/test_notebooks.py b/test/test_notebooks.py index b25d20fd..e75959f2 100644 --- a/test/test_notebooks.py +++ b/test/test_notebooks.py @@ -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]