Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kadrlica committed Jun 26, 2024
1 parent 1b2c254 commit 102a271
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
python-version: ["2.7", "3.10"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
# Exclude notebook tests
nosetests -v -I test_notebook.py;
- name: Test notebooks
if: ${{ matrix.python-version == '2.7' }}
if: ${{ true }}
run: |
source activate env
conda install -q jupyter nbconvert -c conda-forge
Expand Down
10 changes: 6 additions & 4 deletions tests/test_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Adapted from:
https://blog.thedataincubator.com/2016/06/testing-jupyter-notebooks/
"""
import os
import os,sys
import unittest
import glob

Expand All @@ -18,11 +18,13 @@ def _notebook_run(path):
"""Execute a notebook via nbconvert and collect output.
:returns (parsed nb object, execution errors)
"""
kernel_name = "python"+str(sys.version_info.major)
with tempfile.NamedTemporaryFile(suffix=".ipynb") as fout:
args = ["jupyter", "nbconvert", "--to", "notebook", "--execute",
"--ExecutePreprocessor.timeout=60",
"--log-level=WARN",
"--output", fout.name, path]
"--ExecutePreprocessor.timeout=60",
"--kernel_name", kernel_name,
"--log-level=WARN",
"--output", fout.name, path]
subprocess.check_call(args)

fout.seek(0)
Expand Down

0 comments on commit 102a271

Please sign in to comment.