diff --git a/USAGE.md b/USAGE.md index 6723dd6..8d7131f 100644 --- a/USAGE.md +++ b/USAGE.md @@ -103,13 +103,13 @@ This is not the best way to put code in production but it can help out in some o ### Limits -* Only the graphic package `matplotlib.pyplot` as been tested. Use other graphic option at your on risk. +* Only the graphic package `matplotlib.pyplot` as been tested. Other graphic package may not give back the hand. -* Only python code can be executed, donnot try to use the package on notebook with julia or R. +* Only python code can be executed. The package will **not** work on julia or R notebooks. * When executing a notebook via `boar` make sure the environment has all the package to run the notebook. -* The package has not been developped to work recursively. Use at your own risk. +* The package has not been developped to work recursively. ### Forbidden synthax diff --git a/notebook/00-test-tutorial.ipynb b/notebook/00-test-tutorial.ipynb index 1c6c886..6fc69df 100644 --- a/notebook/00-test-tutorial.ipynb +++ b/notebook/00-test-tutorial.ipynb @@ -93,7 +93,7 @@ " test_error_str = test_path.name.replace(\".ipynb\", \"\").split(\"-\")[0]\n", " \n", " test_error = None\n", - " if test_error_str!=\"OK\":\n", + " if test_error_str not in [\"OK\", \"Matplotlib\"]:\n", " temp = {}\n", " exec(f\"error = {test_error_str}\", temp)\n", " test_error = temp[\"error\"] \n", diff --git a/notebook/00-test/Matplotlib.ipynb b/notebook/00-test/Matplotlib.ipynb new file mode 100644 index 0000000..d7e3621 --- /dev/null +++ b/notebook/00-test/Matplotlib.ipynb @@ -0,0 +1,69 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Matplotlib graph" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "x_vals = np.arange(1, 10, 0.5)\n", + "y_vals = (x_vals) * (x_vals - 5) * (x_vals - 7.5) \n", + "\n", + "\n", + "plt.figure()\n", + "\n", + "plt.plot(x_vals, y_vals)\n", + "plt.scatter(x_vals, y_vals, color=\"r\", marker=\"x\")\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "---" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/tests/test_testing_e2e.py b/tests/test_testing_e2e.py index b178e9d..a56458c 100644 --- a/tests/test_testing_e2e.py +++ b/tests/test_testing_e2e.py @@ -6,10 +6,14 @@ @pytest.mark.e2e -def test_assert_notebook_runs_without_error() -> None: +@pytest.mark.parametrize("notebook_name", [ + "OK.ipynb", + "Matplotlib.ipynb", +]) +def test_assert_notebook_runs_without_error(notebook_name) -> None: # Given from boar.testing import assert_notebook - notebook_path = Path(Notebook._00.value, "OK.ipynb") + notebook_path = Path(Notebook._00.value, notebook_name) verbose = True # When / Then