Skip to content

Commit

Permalink
Migrate to new ert import structure
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreso committed Aug 18, 2022
1 parent 45d4fab commit c095651
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_vs_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Run test vs ERT
# the promise install is needed due to bug in ERT installer; remove when fixed
run: >
python -m pip install ert &&
python -m pip install ert>=2.38.0b5 &&
python -m pip install promise &&
python -m pytest tests/test_vs_ert --disable-warnings -x
8 changes: 6 additions & 2 deletions src/xtgeoapp_grd3dmaps/hook_implementations/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
import os
from pkg_resources import resource_filename

from ert_shared.plugins.plugin_manager import hook_implementation
from ert_shared.plugins.plugin_response import plugin_response
try:
from ert_shared.plugins.plugin_manager import hook_implementation
from ert_shared.plugins.plugin_response import plugin_response
except ModuleNotFoundError:
from ert.shared.plugins.plugin_manager import hook_implementation
from ert.shared.plugins.plugin_response import plugin_response

PLUGIN_NAME = "xtgeoapp_grd3dmaps"

Expand Down
14 changes: 10 additions & 4 deletions tests/test_vs_ert/test_hook_implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@
try:
import ert_shared # noqa
except ImportError:
pytest.skip(
"Not testing ERT hooks when ERT is not installed", allow_module_level=True
)
try:
import ert # noqa
except ImportError:
pytest.skip(
"Not testing ERT hooks when ERT is not installed", allow_module_level=True
)

import xtgeoapp_grd3dmaps.hook_implementations.jobs as jobs
from ert_shared.plugins.plugin_manager import ErtPluginManager
try:
from ert_shared.plugins.plugin_manager import ErtPluginManager
except ModuleNotFoundError:
from ert.shared.plugins.plugin_manager import ErtPluginManager

EXPECTED_JOBS = {
"GRID3D_AVERAGE_MAP": "xtgeoapp_grd3dmaps/config_jobs/GRID3D_AVERAGE_MAP",
Expand Down

0 comments on commit c095651

Please sign in to comment.