Skip to content

Commit f9786d7

Browse files
committed
loosen kernel checking
1 parent e372671 commit f9786d7

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

extras/test_notebooks.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
from .lib.nb_helper import get_tags, is_h1, is_markdown, is_python, read_notebook
1111

1212

13-
def check_metadata(notebook, file, expected_kernel):
13+
def check_metadata(notebook, file):
1414
metadata = notebook.metadata
15-
runtime = metadata.kernelspec.display_name
15+
runtime = metadata.kernelspec.name
1616

17-
# seems the asterisk is added for the "preferred kernel"
18-
assert runtime == expected_kernel or runtime == f"{expected_kernel} *"
17+
assert runtime == "python3"
1918
assert metadata.language_info.version.startswith("3.")
2019

2120
if "colab" in metadata:
@@ -25,9 +24,9 @@ def check_metadata(notebook, file, expected_kernel):
2524
)
2625

2726

28-
def check_file(file, expected_kernel="Python 3 (ipykernel)"):
27+
def check_file(file):
2928
notebook = read_notebook(file)
30-
check_metadata(notebook, file, expected_kernel)
29+
check_metadata(notebook, file)
3130

3231

3332
notebooks = glob("*.ipynb")
@@ -43,7 +42,7 @@ def test_class_notebooks(notebook):
4342

4443
def test_colab():
4544
# run in Google Colab
46-
check_file(crash_course, "Python 3")
45+
check_file(crash_course)
4746

4847

4948
@pytest.mark.parametrize("file", all_notebooks)

0 commit comments

Comments
 (0)