Skip to content

Commit 1b5aeba

Browse files
committed
ci
1 parent 9915616 commit 1b5aeba

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

dev_tools/check-notebook-tests.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import subprocess
2727
import sys
2828
from pathlib import Path
29-
from typing import Dict, Tuple
29+
from typing import cast, Dict, Tuple
3030

3131
from qualtran_dev_tools.git_tools import get_git_root
3232

@@ -40,7 +40,11 @@ def get_committed_notebooks(reporoot: Path) -> Dict[str, Path]:
4040
not user-facing documentation.
4141
"""
4242
result = subprocess.run(
43-
['git', 'ls-files', '--', '**/*.ipynb'], capture_output=True, text=True, check=True, cwd=reporoot
43+
['git', 'ls-files', '--', '**/*.ipynb'],
44+
capture_output=True,
45+
text=True,
46+
check=True,
47+
cwd=reporoot,
4448
)
4549
return {
4650
Path(f).stem: Path(f)
@@ -83,7 +87,7 @@ def find_notebook_tests(reporoot: Path) -> Dict[str, Tuple[Path, bool]]:
8387
and child.args
8488
and isinstance(child.args[0], ast.Constant)
8589
):
86-
nb_name = child.args[0].value
90+
nb_name: str = cast(str, child.args[0].value)
8791
# Check for @pytest.mark.notebook decorator
8892
has_marker = any(_is_notebook_marker(dec) for dec in node.decorator_list)
8993
results[nb_name] = (test_file.relative_to(reporoot), has_marker)

0 commit comments

Comments
 (0)