Skip to content

Commit

Permalink
Derive Desktop version for IronPython Unit tests if being run from wi…
Browse files Browse the repository at this point in the history
…thin desktop (#618)
  • Loading branch information
kbhagat-ansys authored Dec 3, 2021
1 parent 955c17b commit 0cd9a46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _unittest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import json
import gc
import sys
from pyaedt.generic.general_methods import is_ironpython
from pyaedt.generic.general_methods import is_ironpython, inside_desktop

if is_ironpython:
import _unittest_ironpython.conf_unittest as pytest
Expand Down Expand Up @@ -57,7 +57,10 @@
with open(local_config_file) as f:
config = json.load(f)
else:
config = {"desktopVersion": "2021.2", "NonGraphical": False, "NewThread": True, "test_desktops": False,
default_version = "2021.2"
if inside_desktop and "oDesktop" in dir(sys.modules['__main__']):
default_version = sys.modules['__main__'].oDesktop.GetVersion()[0:6]
config = {"desktopVersion": default_version, "NonGraphical": False, "NewThread": True, "test_desktops": False,
"build_machine": True, "skip_space_claim": False, "skip_circuits": False, "skip_edb": False,
"skip_debug": False, "local": False}

Expand Down

0 comments on commit 0cd9a46

Please sign in to comment.