| import pytest | |
| from pathlib import Path | |
| def root_dir(): | |
| return Path(__file__).parents[2] | |
| def chdir_to_root(root_dir, monkeypatch): | |
| monkeypatch.chdir(root_dir) | |
| def test_example(script_file): | |
| import subprocess | |
| subprocess.run(["python", f"examples/{script_file}"], check=True) |