Skip to content

Commit

Permalink
Fix integration tests (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
widerschein authored May 6, 2024
1 parent d50c0fa commit a0c0f32
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ansys/optislang/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@
from ansys.optislang.core.osl_process import OslServerProcess, ServerNotification

# Provide examples directory path
examples = "ansys.optislang.core.examples"
if spec := importlib.util.find_spec(examples):
EXAMPLES_MODULE = "ansys.optislang.core.examples"
if spec := importlib.util.find_spec(EXAMPLES_MODULE):
if spec.origin:
os.environ["OSL_EXAMPLES"] = os.path.dirname(spec.origin)
else:
LOG.logger.warning(f"Could not set path to examples. Missing spec for module {examples}.")
LOG.logger.warning(
f"Could not set path to examples. Missing spec for module {EXAMPLES_MODULE}."
)
else:
LOG.logger.warning(f"Could not set path to examples. Missing origin for module {examples}.")
LOG.logger.warning(
f"Could not set path to examples. Missing origin for module {EXAMPLES_MODULE}."
)

0 comments on commit a0c0f32

Please sign in to comment.