Newer
Older

Mads M. Pedersen
committed

Mads M. Pedersen
committed
from py_wake.tests.notebook import Notebook

Mads M. Pedersen
committed
path = os.path.dirname(py_wake.__file__) + "/../docs/notebooks/"
return [Notebook(path + f) for f in [f for f in os.listdir(path) if f.endswith('.ipynb')]]
@pytest.mark.parametrize("notebook", get_notebooks())
def test_notebooks(notebook):
import matplotlib.pyplot as plt
def no_show(*args, **kwargs):
pass
plt.show = no_show # disable plt show that requires the user to close the plot

Mads M. Pedersen
committed
try:
notebook.check_code()
notebook.check_links()
notebook.remove_empty_end_cell()
notebook.check_pip_header()

Mads M. Pedersen
committed
pass
except Exception as e:
raise Exception(notebook.filename + " failed") from e