Skip to content

Commit 88dcb5f

Browse files
committed
Add unittest for Jupyter extension
1 parent d842b8a commit 88dcb5f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Install dependencies
7171
run: |
7272
python -m pip install --upgrade pip
73-
pip install flake8 pytest pytest-cov
73+
pip install flake8 pytest pytest-cov nbval numpy
7474
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
7575
pip install -e .
7676
- name: Lint with flake8

pytest/test_all.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,21 @@ def test_issue_433():
7575
"""
7676
)
7777
assert out == 25
78+
79+
def test_notebook():
80+
import os
81+
import subprocess
82+
import sys
83+
from pathlib import Path
84+
85+
result = subprocess.run(
86+
[
87+
sys.executable,
88+
"-m",
89+
"pytest",
90+
"--nbval",
91+
str(Path(__file__).parent / "test_nb.ipynb"),
92+
],
93+
env=os.environ,
94+
)
95+
assert result.returncode == 0

0 commit comments

Comments
 (0)