Skip to content

Commit

Permalink
Use ixmp.config.add_platform() in session_context fixture
Browse files Browse the repository at this point in the history
TODO was addressed in iiasa/ixmp#435
  • Loading branch information
khaeru committed Apr 28, 2022
1 parent 3680fca commit 6c537f8
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions message_ix_models/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,15 @@ def session_context(pytestconfig, tmp_env):
# Create some subdirectories
util.MESSAGE_DATA_PATH.joinpath("data", "tests").mkdir(parents=True)

platform_name = "message-ix-models"

# Add a platform connected to an in-memory database
# NB cannot call Config.add_platform() here because it does not support supplying a
# URL for a HyperSQL database.
# TODO add that feature upstream.
ixmp_config.values["platform"][platform_name] = {
"class": "jdbc",
"driver": "hsqldb",
"url": f"jdbc:hsqldb:mem://{platform_name}",
"jvmargs": pytestconfig.option.jvmargs,
}
platform_name = "message-ix-models"
ixmp_config.add_platform(
platform_name,
"jdbc",
"hsqldb",
url=f"jdbc:hsqldb:mem://{platform_name}",
jvmargs=pytestconfig.option.jvmargs,
)

# Launch Platform and connect to testdb (reconnect if closed)
mp = Platform(name=platform_name)
Expand Down

0 comments on commit 6c537f8

Please sign in to comment.