Skip to content

Commit b9d7339

Browse files
authored
fix validation script (openvinotoolkit#1187)
1 parent c3b5767 commit b9d7339

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.ci/validate_notebooks.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import subprocess # nosec - disable B404:import-subprocess check
44
import csv
55
import shutil
6+
import platform
67
from pathlib import Path
78
from argparse import ArgumentParser
89

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

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

103104
clean_test_artifacts(existing_files, sorted(Path('.').iterdir()))
104105
return retcode

0 commit comments

Comments
 (0)