@@ -41,30 +41,27 @@ def pytest_addoption(parser):
4141
4242
4343def pytest_collection_modifyitems (config , items ):
44- if config .getoption ("--corba" ):
44+ if not config .getoption ("--corba" ):
4545 # --corba given in cli: run CORBA interface tests
46- return
47- skip_corba = pytest .mark .skip (reason = "need --corba option to run" )
48- for item in items :
49- if "corba" in item .keywords :
50- item .add_marker (skip_corba )
46+ skip_corba = pytest .mark .skip (reason = "need --corba option to run" )
47+ for item in items :
48+ if "corba" in item .keywords :
49+ item .add_marker (skip_corba )
5150
52- if config .getoption ("--console" ):
51+ if not config .getoption ("--console" ):
5352 # --console given in cli: run console interface tests
54- return
55- skip_console = pytest .mark .skip (reason = "need --console option to run" )
56- for item in items :
57- if "console" in item .keywords :
58- item .add_marker (skip_console )
53+ skip_console = pytest .mark .skip (reason = "need --console option to run" )
54+ for item in items :
55+ if "console" in item .keywords :
56+ item .add_marker (skip_console )
5957
6058
6159@pytest .fixture (scope = "session" )
6260def mapdl_console (request ):
63- ansys_base_paths = _get_available_base_ansys ()
64-
6561 if os .name != 'posix' :
6662 raise RuntimeError ('"--console" testing option unavailable. '
6763 'Only Linux is supported.' )
64+ ansys_base_paths = _get_available_base_ansys ()
6865
6966 # find a valid version of corba
7067 console_path = None
@@ -78,6 +75,8 @@ def mapdl_console(request):
7875 'Valid versions are up to 2020R2.' )
7976
8077 mapdl = launch_mapdl (console_path )
78+ from ansys .mapdl .core .mapdl_console import MapdlConsole
79+ assert isinstance (mapdl , MapdlConsole )
8180 mapdl ._show_matplotlib_figures = False # CI: don't show matplotlib figures
8281
8382 # using yield rather than return here to be able to test exit
@@ -98,7 +97,7 @@ def mapdl_corba(request):
9897 # find a valid version of corba
9998 corba_path = None
10099 for version in ansys_base_paths :
101- if version >= 170 and version < 211 :
100+ if version >= 170 and version < 202 :
102101 corba_path = get_ansys_bin (str (version ))
103102
104103 if corba_path is None :
@@ -107,6 +106,8 @@ def mapdl_corba(request):
107106 'Valid versions are ANSYS 17.0 up to 2020R2.' )
108107
109108 mapdl = launch_mapdl (corba_path )
109+ from ansys .mapdl .core .mapdl_corba import MapdlCorba
110+ assert isinstance (mapdl , MapdlCorba )
110111 mapdl ._show_matplotlib_figures = False # CI: don't show matplotlib figures
111112
112113 # using yield rather than return here to be able to test exit
0 commit comments