-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ImperialCollegeLondon/tutorials
Add test of tutorials
- Loading branch information
Showing
3 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |