Skip to content

Commit

Permalink
Fix paths in test_examples.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ramadhan committed May 9, 2024
1 parent e974700 commit 1d38374
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

from pathlib import Path

def run_example(name):
filepath = Path(__file__).resolve().parent / ".." / "examples" / f"{name}.py"
exec(filepath.read_text())
return

def test_sine_wave():
exec(Path("../examples/sine_wave.py").read_text())
run_example("sine_wave")
assert Path("sine_wave.gif").is_file()

def test_rotating_circular_sine_wave():
exec(Path("../examples/rotating_circular_sine_wave.py").read_text())
run_example("rotating_circular_sine_wave")
assert Path("rotating_circular_sine_wave.mp4").is_file()

0 comments on commit 1d38374

Please sign in to comment.