diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1bf29d..ac46e4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: run: | pytest --cov=heat --cov-report=xml:./coverage.xml -vvv bmi-test heat:BmiHeat --config-file=${GITHUB_WORKSPACE}/examples/heat.yaml --root-dir=examples -vvv + pytest examples --nbmake --nbmake-timeout=3000 --nbmake-kernel=python3 -v - name: Coveralls if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' diff --git a/noxfile.py b/noxfile.py index bcb4d20..af811b0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,6 +25,23 @@ def test(session: nox.Session) -> None: session.run("coverage", "report", "--ignore-errors", "--show-missing") +@nox.session(name="test-examples") +def test_examples(session: nox.Session) -> None: + """Run the example notebooks.""" + session.install(".[testing]") + + session.run( + "pytest", + "examples", + "--nbmake", + "--nbmake-timeout", + "3000", + "--nbmake-kernel", + "python3", + "-v", + ) + + @nox.session def lint(session: nox.Session) -> None: """Look for lint.""" diff --git a/pyproject.toml b/pyproject.toml index 616b8a2..dbe4203 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ testing = [ "isort", "ruff", "bmi-tester", + "nbmake", ] [tool.setuptools.dynamic] diff --git a/requirements-testing.txt b/requirements-testing.txt index d817a46..8608def 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -2,6 +2,7 @@ black bmi-tester coveralls isort +nbmake pytest pytest-cov ruff