Skip to content
Snippets Groups Projects
Commit 6d605376 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add PYRO-NN to sys.path in test_pyronn_examples

parent a932a4b2
Branches
No related merge requests found
Pipeline #18186 failed with stage
in 7 minutes and 39 seconds
......@@ -8,6 +8,7 @@
"""
import importlib.util
import sys
from glob import glob
from os.path import basename, dirname, join
......@@ -16,11 +17,11 @@ def test_pyronn_examples():
example_files_glob = join(dirname(__file__), 'PYRO-NN', 'examples', '**', '*.py')
example_files = glob(example_files_glob, recursive=True)
sys.path.append(join(dirname(__file__), 'PYRO-NN'))
for file in example_files:
print(file)
print(basename(file))
spec = importlib.util.spec_from_file_location(basename(file), file)
foo = importlib.util.module_from_spec(spec)
spec.loader.exec_module(foo)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment