Skip to content

Commit

Permalink
Move test_examples to test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroFernandezLuces committed Jan 17, 2024
1 parent 6330849 commit 394be72
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ instance/

# Sphinx documentation
doc/_build/
doc/source/examples

# PyBuilder
.pybuilder/
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ dependencies = [
[project.optional-dependencies]
tests = [
"pytest==7.4.4",
"pytest-cov==4.1.0",

]
doc = [
"ansys-sphinx-theme==0.9.9",
Expand Down
12 changes: 0 additions & 12 deletions test_examples.py

This file was deleted.

13 changes: 13 additions & 0 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
from pathlib import Path
import subprocess
import sys

import pytest

ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
EXAMPLES_DIR = Path(os.path.join(ROOT_DIR, "examples"))

@pytest.mark.parametrize("example_path", list(EXAMPLES_DIR.rglob("*.py")))
def test_examples(example_path: Path) -> None:
subprocess.check_call([sys.executable, str(example_path.absolute())])

0 comments on commit 394be72

Please sign in to comment.