Skip to content

Commit

Permalink
Merge pull request #52 from ImperialCollegeLondon/tutorials
Browse files Browse the repository at this point in the history
Add test of tutorials
  • Loading branch information
dalonsoa authored Jan 11, 2024
2 parents c89535e + d29bac7 commit 491d41e
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ dev = [
"black",
"ruff",
"pip-tools",
"pytest-cov",
"geopandas",
"matplotlib",
"shapely",
"pytest-cov"
]

Expand Down
57 changes: 53 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,80 @@
#
# pip-compile --extra=dev --output-file=requirements-dev.txt
#
attrs==23.2.0
# via fiona
black==23.10.1
# via wsimod (pyproject.toml)
build==1.0.3
# via pip-tools
certifi==2023.11.17
# via
# fiona
# pyproj
cfgv==3.4.0
# via pre-commit
click==8.1.7
# via
# black
# click-plugins
# cligj
# fiona
# pip-tools
click-plugins==1.1.1
# via fiona
cligj==0.7.2
# via fiona
contourpy==1.2.0
# via matplotlib
coverage[toml]==7.3.2
# via pytest-cov
cycler==0.12.1
# via matplotlib
dill==0.3.7
# via wsimod (pyproject.toml)
distlib==0.3.7
# via virtualenv
filelock==3.13.1
# via virtualenv
fiona==1.9.5
# via geopandas
fonttools==4.47.0
# via matplotlib
geopandas==0.14.2
# via wsimod (pyproject.toml)
identify==2.5.31
# via pre-commit
iniconfig==2.0.0
# via pytest
kiwisolver==1.4.5
# via matplotlib
matplotlib==3.8.2
# via wsimod (pyproject.toml)
mypy-extensions==1.0.0
# via black
nodeenv==1.8.0
# via pre-commit
numpy==1.26.2
# via pandas
# via
# contourpy
# matplotlib
# pandas
# shapely
packaging==23.2
# via
# black
# build
# geopandas
# matplotlib
# pytest
pandas==2.1.3
# via wsimod (pyproject.toml)
# via
# geopandas
# wsimod (pyproject.toml)
pathspec==0.11.2
# via black
pillow==10.2.0
# via matplotlib
pip-tools==7.3.0
# via wsimod (pyproject.toml)
platformdirs==3.11.0
Expand All @@ -51,6 +88,10 @@ pluggy==1.3.0
# via pytest
pre-commit==3.5.0
# via wsimod (pyproject.toml)
pyparsing==3.1.1
# via matplotlib
pyproj==3.6.1
# via geopandas
pyproject-hooks==1.0.0
# via build
pytest==7.4.3
Expand All @@ -60,7 +101,9 @@ pytest==7.4.3
pytest-cov==4.1.0
# via wsimod (pyproject.toml)
python-dateutil==2.8.2
# via pandas
# via
# matplotlib
# pandas
pytz==2023.3.post1
# via pandas
pyyaml==6.0.1
Expand All @@ -69,8 +112,14 @@ pyyaml==6.0.1
# wsimod (pyproject.toml)
ruff==0.1.4
# via wsimod (pyproject.toml)
shapely==2.0.2
# via
# geopandas
# wsimod (pyproject.toml)
six==1.16.0
# via python-dateutil
# via
# fiona
# python-dateutil
tqdm==4.66.1
# via wsimod (pyproject.toml)
tzdata==2023.3
Expand Down
18 changes: 18 additions & 0 deletions tests/test_tutorials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pathlib import Path
from typing import List

from pytest import mark


def available_tutorials() -> List[Path]:
"""Locate the available tutorials in the docs."""
base_path = Path(__file__).parent.parent / "docs" / "demo"
return [p for p in base_path.rglob("*.py")]


@mark.parametrize("tutorial", available_tutorials())
def test_tutorials(tutorial):
import subprocess
import sys

subprocess.run([sys.executable, tutorial]).check_returncode()

0 comments on commit 491d41e

Please sign in to comment.