From a6b72e535c67fb36746c77eb681cbb3a718d7ba3 Mon Sep 17 00:00:00 2001 From: Ilya Matiach Date: Wed, 8 Jul 2020 00:08:06 -0400 Subject: [PATCH] set use_cdn=False in notebook tests (#281) --- test/test_notebooks.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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]