File tree Expand file tree Collapse file tree 2 files changed +29
-23
lines changed
Expand file tree Collapse file tree 2 files changed +29
-23
lines changed Original file line number Diff line number Diff line change 2525
2626 - name : Test built package
2727 run : |
28- pip install pytest
28+ pip install pytest pytest-cov
2929 pip install ./target
30- pytest -v pipeline/tests
30+ pytest -v --cov=openminds --cov-report term pipeline/tests
Original file line number Diff line number Diff line change 22Tests for openMINDS Python module
33"""
44
5+ from importlib import import_module
6+ import sys
7+
58import pytest
69
710from openminds .base import Node , IRI
8- from openminds .latest import (
9- chemicals ,
10- computation ,
11- controlled_terms ,
12- core ,
13- ephys ,
14- publications ,
15- sands ,
16- specimen_prep ,
17- stimulation ,
18- )
11+
1912from utils import build_fake_node
2013
21- all_modules = (
22- chemicals ,
23- computation ,
24- controlled_terms ,
25- core ,
26- ephys ,
27- publications ,
28- sands ,
29- specimen_prep ,
30- stimulation ,
14+ module_names = (
15+ " chemicals" ,
16+ " computation" ,
17+ " controlled_terms" ,
18+ " core" ,
19+ " ephys" ,
20+ " publications" ,
21+ " sands" ,
22+ " specimen_prep" ,
23+ " stimulation" ,
3124)
25+ versions = ("v3" , "v4" , "latest" ) # "v1" and "v2" currently produce errors
26+
27+ all_modules = []
28+ for version in versions :
29+ for module_name in module_names :
30+ path = f"openminds.{ version } .{ module_name } "
31+ try :
32+ module = import_module (path )
33+ except ModuleNotFoundError :
34+ continue
35+ else :
36+ sys .modules [path ] = module
37+ all_modules .append (module )
3238
3339
3440def classes_in_module (module ):
You can’t perform that action at this time.
0 commit comments