Skip to content

Commit

Permalink
Attempt to fix example sequence tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankZijlstra committed Jan 10, 2025
1 parent b1a66d2 commit 3a4a6be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,19 @@ def seq4():
# Derive the relative path from the test file to the examples folder
examples_dir = Path(__file__).resolve().parents[1] / 'examples' / 'scripts'

for example in seq_examples:

def make_test_func(example):
def test_func(module_name=f'examples.{example}'):
spec = importlib.util.spec_from_file_location(module_name, examples_dir / f'{example}.py') # noqa: B023
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module.main()

test_func.__name__ = example
sequence_zoo.append(test_func)

return test_func

for example in seq_examples:
sequence_zoo.append(make_test_func(example)


# Main Sequence test class
Expand Down

0 comments on commit 3a4a6be

Please sign in to comment.