From 540ea3ddc17fd2f27070fdaad79453dc2d58be5e Mon Sep 17 00:00:00 2001 From: joshkamm Date: Sat, 10 Feb 2024 02:38:52 -0500 Subject: [PATCH] wip #54 changing to example directory inside pytest test --- tests/test_examples.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_examples.py b/tests/test_examples.py index 5ab0c0d..ad92058 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,3 +1,4 @@ +import os from pathlib import Path import runpy @@ -9,6 +10,7 @@ def test_examples(): def test_suzuki_example(): - # CHANGE DIRECTORY INTO THE SUZUKI EXAMPLE BEFORE EXECUTING THE SCRIPT - example_vars = runpy.run_path(Path(__file__).parents[1] / 'examples' / 'suzuki' / 'suzuki.py') + example_path = Path(__file__).parents[1] / 'examples' / 'suzuki' + os.chdir(example_path) + example_vars = runpy.run_path(example_path / 'suzuki.py') \ No newline at end of file