Skip to content

Commit f653eac

Browse files
committed
Add code to skip torch notebook
Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
1 parent 6afa171 commit f653eac

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/test_notebooks.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import os
66
import subprocess
7+
import sys
78
import tempfile
89

910
import nbformat
@@ -16,7 +17,11 @@
1617
"DiCE_with_advanced_options.ipynb", # requires tensorflow 1.x
1718
"DiCE_getting_started_feasible.ipynb", # needs changes after latest refactor
1819
"Benchmarking_different_CF_explanation_methods.ipynb"
19-
]
20+
]
21+
# notebooks that don't need to run on python 3.10
22+
torch_notebooks_not_3_10 = [
23+
"DiCE_getting_started.ipynb"
24+
]
2025

2126
# Adding the dice root folder to the python path so that jupyter notebooks
2227
if 'PYTHONPATH' not in os.environ:
@@ -77,6 +82,11 @@ def _notebook_run(filepath):
7782
nb,
7883
marks=[pytest.mark.skip, pytest.mark.advanced],
7984
id=nb)
85+
elif sys.version >= (3, 10) and nb in torch_notebooks_not_3_10:
86+
param = pytest.param(
87+
nb,
88+
marks=[pytest.mark.skip, pytest.mark.advanced],
89+
id=nb)
8090
else:
8191
param = pytest.param(nb, id=nb)
8292
parameter_list.append(param)

0 commit comments

Comments
 (0)