Skip to content

Commit

Permalink
Update to latest ixmp4 testing sqlite setup
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Nov 3, 2024
1 parent 9dec006 commit 2b060ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pandas as pd
import pytest
from httpx import ConnectError
from ixmp4.conf.base import PlatformInfo
from ixmp4.core import Platform
from ixmp4.data.backend import SqliteTestBackend

Expand Down Expand Up @@ -267,11 +268,20 @@ def plot_stackplot_df():

@pytest.fixture(scope="function")
def test_platform():
platform = Platform(_backend=SqliteTestBackend())
sqlite = SqliteTestBackend(
PlatformInfo(name="sqlite-test", dsn="sqlite:///:memory:")
)
sqlite.setup()

platform = Platform(_backend=sqlite)
platform.regions.create(name="World", hierarchy="common")
platform.units.create(name="EJ/yr")

yield platform

sqlite.close()
sqlite.teardown()


@pytest.fixture(scope="session")
def conn():
Expand Down

0 comments on commit 2b060ef

Please sign in to comment.