Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 2-platform cloning & associated tests #182

Merged
merged 4 commits into from
Apr 1, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unused test fixtures
  • Loading branch information
khaeru committed Apr 1, 2019
commit ac5695ad786829354a75785a0111703a05afa7f4
56 changes: 0 additions & 56 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import os
import pytest
import shutil
import subprocess
import tempfile

import ixmp

from ixmp.default_path_constants import CONFIG_PATH

here = os.path.dirname(os.path.realpath(__file__))

Expand Down Expand Up @@ -48,60 +46,6 @@ def test_mp():
yield mp


@pytest.fixture()
def test_mp_use_db_config_path():
assert not os.path.exists(CONFIG_PATH)

test_props = create_local_testdb()
dirname = os.path.dirname(test_props)
basename = os.path.basename(test_props)

# configure
cmd = 'ixmp-config --db_config_path {}'.format(dirname)
subprocess.check_call(cmd.split())

# start jvm
ixmp.start_jvm()

# launch Platform and connect to testdb (reconnect if closed)
try:
mp = ixmp.Platform(basename)
mp.open_db()
except:
os.remove(CONFIG_PATH)
raise

yield mp

os.remove(CONFIG_PATH)


@pytest.fixture()
def test_mp_use_default_dbprops_file():
assert not os.path.exists(CONFIG_PATH)

test_props = create_local_testdb()

# configure
cmd = 'ixmp-config --default_dbprops_file {}'.format(test_props)
subprocess.check_call(cmd.split())

# start jvm
ixmp.start_jvm()

# launch Platform and connect to testdb (reconnect if closed)
try:
mp = ixmp.Platform()
mp.open_db()
except:
os.remove(CONFIG_PATH)
raise

yield mp

os.remove(CONFIG_PATH)


@pytest.fixture(scope="session")
def test_mp_props():
test_props = create_local_testdb()
Expand Down