Skip to content

Commit 8354666

Browse files
committed
Use file name
1 parent 26c7e2e commit 8354666

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_links.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import httpx
55
import nbformat
66
import pytest
7-
from utils_for_tests import iterate_notebooks
7+
from utils_for_tests import iterate_notebook_names, resolve_notebook_path
88

99
# the regex below is taken from this stackoverflow:
1010
# https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url
@@ -15,7 +15,7 @@
1515
URL_IN_MARKDOWN_REGEX = re.compile(r"(?<=\]\()%s(?=\s*\))" % URL_REGEX)
1616

1717

18-
@pytest.mark.parametrize("notebook_path", iterate_notebooks())
18+
@pytest.mark.parametrize("notebook_path", iterate_notebook_names())
1919
def test_links(notebook_path: str) -> None:
2020
for cell_index, url in iterate_links_from_notebook(notebook_path):
2121
assert _test_single_url(
@@ -24,7 +24,7 @@ def test_links(notebook_path: str) -> None:
2424

2525

2626
def iterate_links_from_notebook(filename: str) -> Iterable[tuple[int, str]]:
27-
with open(filename) as f:
27+
with open(resolve_notebook_path(filename)) as f:
2828
notebook_data = nbformat.read(f, nbformat.NO_CONVERT)
2929

3030
markdown_cells = [c for c in notebook_data["cells"] if c["cell_type"] == "markdown"]

0 commit comments

Comments
 (0)