Skip to content

Commit

Permalink
fix validation script (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Jul 13, 2023
1 parent c3b5767 commit b9d7339
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .ci/validate_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import subprocess # nosec - disable B404:import-subprocess check
import csv
import shutil
import platform
from pathlib import Path
from argparse import ArgumentParser

Expand Down Expand Up @@ -36,7 +37,7 @@ def prepare_test_plan(test_list, ignore_list, nb_dir=None):
notebooks = sorted(list(notebooks_dir.rglob('**/*.ipynb')))
statuses = {notebook.parent.relative_to(notebooks_dir): {'status': '', 'path': notebook.parent} for notebook in notebooks}
test_list = test_list or statuses.keys()
if len(ignore_list) == 1 and ignore_list[0].endswith('.txt'):
if ignore_list is not None and len(ignore_list) == 1 and ignore_list[0].endswith('.txt'):
with open(ignore_list[0], 'r') as f:
ignore_list = list(map(lambda x: x.strip(), f.readlines()))
print(f"ignored notebooks: {ignore_list}")
Expand Down Expand Up @@ -98,7 +99,7 @@ def run_test(notebook_path, root):
return 0

main_command = [sys.executable, '-m', 'treon', notebook_name]
retcode = subprocess.run(main_command).returncode
retcode = subprocess.run(main_command, shell=(platform.system() == "Windows")).returncode

clean_test_artifacts(existing_files, sorted(Path('.').iterdir()))
return retcode
Expand Down

0 comments on commit b9d7339

Please sign in to comment.