added documentation to test_examples.py
+'''
+Run examples/*.py using pytest
+'''
+
import importlib.util as iu
import os
from pathlib import Path
@@ -6,6 +10,10 @@ cwd = Path(os.path.dirname(os.path.abspath(__file__)))
examples_dir = cwd.joinpath('../examples')
def run_example(name):
+ """
+ Execute an example py script as __main__
+ :param name: the filename without the .py extension
+ """
spec = iu.spec_from_file_location("__main__", examples_dir.joinpath(f"{name}.py"))
module = iu.module_from_spec(spec)
spec.loader.exec_module(module)
