1
0
mirror of https://github.com/gsi-upm/soil synced 2024-11-24 11:52:29 +00:00

Add tutorial test to CI/CD

This commit is contained in:
J. Fernando Sánchez 2023-04-24 18:05:07 +02:00
parent 3802578ad5
commit 93d23e4cab
2 changed files with 163 additions and 189 deletions

File diff suppressed because one or more lines are too long

18
tests/test_ipython.py Normal file
View File

@ -0,0 +1,18 @@
from unittest import TestCase
import os
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
ROOT = os.path.abspath(os.path.dirname(__file__))
class TestNotebooks(TestCase):
def test_tutorial(self):
notebook = os.path.join(ROOT, "../examples/tutorial/soil_tutorial.ipynb")
with open(notebook) as f:
nb = nbformat.read(f, as_version=4)
ep = ExecutePreprocessor(timeout=60000, kernel_name='python3')
try:
assert ep.preprocess(nb) is not None, f"Got empty notebook for {notebook}"
except Exception:
assert False, f"Failed executing {notebook}"