Skip to content

Commit a9854c8

Browse files
authored
Merge pull request #413 from zivy/updateTesting
Update testing
2 parents 6a8bff6 + fadf4a9 commit a9854c8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ jobs:
7575
fi
7676
- name: Install dependencies
7777
run: |
78-
pip install --upgrade pip
79-
pip install -r requirements_dev.txt
78+
python -m pip install --upgrade pip
79+
python -m pip install -r requirements_dev.txt
8080
jupyter nbextension enable --py --sys-prefix widgetsnbextension
8181
- name: Install SimpleITK from test PyPi from manually launched workflow
8282
if: ${{ inputs.testPyPi }}

tests/test_notebooks.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,14 @@ def dynamic_analysis(self, path, kernel_name):
318318

319319
# Execute the notebook and allow errors (run all cells), output is
320320
# written to a temporary file which is automatically deleted.
321-
# The delete=False is here to address an issue that Windows has with temporary files.
322-
# On windows, if delete=True the file is kept open and cannot be read from.
321+
# Windows has a bug with temporary files. On windows, if delete=True
322+
# the file is kept open and cannot be read from
323323
# (see https://github.com/python/cpython/issues/58451).
324-
with tempfile.NamedTemporaryFile(suffix=".ipynb", delete=False) as fout:
324+
# We set the delete flag to False on windows and True on all
325+
# other operating systems, circumventing the issue.
326+
with tempfile.NamedTemporaryFile(
327+
suffix=".ipynb", delete=os.name != "nt"
328+
) as fout:
325329
output_dir, output_fname = os.path.split(fout.name)
326330
args = [
327331
"jupyter",

0 commit comments

Comments
 (0)