[tests] add some slow tests

This commit is contained in:
Forgejo Actions 2026-04-21 19:40:49 -07:00
commit 010da1ccf5
7 changed files with 162 additions and 8 deletions

View file

@ -0,0 +1,47 @@
from pathlib import Path
import os
import subprocess
import sys
import pytest
pytestmark = pytest.mark.complete
REPO_ROOT = Path(__file__).resolve().parents[2]
def _run_example(example_name: str, tmp_path: Path) -> subprocess.CompletedProcess[str]:
env = os.environ.copy()
env['MPLBACKEND'] = 'Agg'
env['MPLCONFIGDIR'] = str(tmp_path / f'mpl-{example_name}')
return subprocess.run(
[sys.executable, str(REPO_ROOT / 'examples' / example_name)],
cwd=REPO_ROOT,
env=env,
text=True,
capture_output=True,
check=False,
timeout=60,
)
def test_eme_example_smoke_runs(tmp_path: Path) -> None:
pytest.importorskip('matplotlib')
result = _run_example('eme.py', tmp_path)
assert result.returncode == 0, result.stdout + result.stderr
assert 'left effective indices:' in result.stdout
assert 'fundamental left-to-right transmission' in result.stdout
def test_eme_bend_example_smoke_runs(tmp_path: Path) -> None:
pytest.importorskip('matplotlib')
pytest.importorskip('skrf')
result = _run_example('eme_bend.py', tmp_path)
assert result.returncode == 0, result.stdout + result.stderr
assert 'straight effective indices:' in result.stdout
assert 'cascaded bend through power' in result.stdout