Skip to content

Commit

Permalink
only test notebooks that are checked into git (#3713)
Browse files Browse the repository at this point in the history
This helps with local running of the notebook tests - it will only pick up notebooks that are checked into git.
Related to #3603.
  • Loading branch information
balopat committed Jan 29, 2021
1 parent 18c97b3 commit 239936d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dev_tools/notebook_test.py
Expand Up @@ -14,7 +14,9 @@
import functools
import glob
import os
import subprocess
import sys
from typing import Set

import pytest
from filelock import FileLock
Expand All @@ -35,8 +37,13 @@
]


def _list_all_notebooks() -> Set[str]:
output = subprocess.check_output(['git', 'ls-files', '*.ipynb'])
return set(output.decode('utf-8').splitlines())


def _tested_notebooks():
all_notebooks = set(glob.glob("**/*.ipynb", recursive=True))
all_notebooks = _list_all_notebooks()
skipped_notebooks = functools.reduce(
lambda a, b: a.union(b), list(set(glob.glob(g, recursive=True)) for g in SKIP_NOTEBOOKS)
)
Expand Down

0 comments on commit 239936d

Please sign in to comment.