Files
3d_audio/lib_audio_dsp/test/pipeline/test_doc_examples.py

25 lines
623 B
Python
Raw Normal View History

2025-12-11 09:43:42 +08:00
# Copyright 2024-2025 XMOS LIMITED.
# This Software is subject to the terms of the XMOS Public Licence: Version 1.
from pathlib import Path
import pytest
import sys
from subprocess import run
from filelock import FileLock
from python import build_utils
EXAMPLES_DIR = Path(__file__).parent/"doc_examples"
EXAMPLES = list(EXAMPLES_DIR.glob("*.py"))
@pytest.mark.parametrize("example", EXAMPLES, ids=[e.name for e in EXAMPLES])
def test_doc_examples(example):
"""Run all the Python scripts in doc_examples/"""
with FileLock(build_utils.BUILD_LOCK):
run([sys.executable, example], check=True)