Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rvhonorato committed Apr 22, 2024
1 parent 870ac48 commit 012d613
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
19 changes: 4 additions & 15 deletions tests/test_consadjust_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pytest

from . import GOLDEN_DATA_PATH
from whiscy.modules import PARAM_PATH

env = os.environ.copy()
env["PYTHONPATH"] = str(
Expand All @@ -24,16 +23,6 @@ def cons_file():
return Path(GOLDEN_DATA_PATH, "regression_consadjust", "2SNIE.cons")


@pytest.fixture
def weight_ma_file():
return Path(PARAM_PATH, "weight_ma.txt")


@pytest.fixture
def ztable_file():
return Path(PARAM_PATH, "ztable.txt")


@pytest.fixture
def acons_file():
return Path(GOLDEN_DATA_PATH, "regression_consadjust", "2SNIE.acons")
Expand All @@ -48,12 +37,12 @@ def acons_file():
@pytest.mark.parametrize(
"scratch_path", ["scratch_regression_consadjust"], indirect=True
)
def test_regression_consadjust2SNIE(
scratch_path, cons_file, weight_ma_file, ztable_file, acons_file
):
def test_regression_consadjust2SNIE(scratch_path, cons_file, acons_file):

test_prediction_output = Path(scratch_path, "test.prediction")
cmd_line = f"{sys.executable} {CONSADJUST_BIN} {cons_file} {weight_ma_file} {ztable_file} -o {test_prediction_output}"
cmd_line = (
f"{sys.executable} {CONSADJUST_BIN} {cons_file} -o {test_prediction_output}"
)

result = subprocess.run(
cmd_line.split(),
Expand Down
9 changes: 1 addition & 8 deletions tests/test_parasmooth_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pytest

from . import GOLDEN_DATA_PATH
from whiscy.modules import PARAM_PATH

PARASMOOTH_BIN = Path(
Path(__file__).parent.parent, "src", "whiscy", "cli_parasmooth.py"
Expand All @@ -34,11 +33,6 @@ def rd_file():
return Path(GOLDEN_DATA_PATH, "regression_parasmooth", "2SNIE.rd")


@pytest.fixture
def par_file():
return Path(PARAM_PATH, "parasmooth.par")


@pytest.fixture
def prediction_file():
return Path(GOLDEN_DATA_PATH, "regression_parasmooth", "2SNIE.parasmooth")
Expand All @@ -53,12 +47,11 @@ def test_regression_2SNIE(
acons_file,
lcons_file,
rd_file,
par_file,
prediction_file,
):

test_prediction_output = Path(scratch_path, "test.prediction")
cmd_line = f"{sys.executable} {PARASMOOTH_BIN} {acons_file} {lcons_file} {rd_file} {par_file} -o {test_prediction_output}"
cmd_line = f"{sys.executable} {PARASMOOTH_BIN} {acons_file} {lcons_file} {rd_file} -o {test_prediction_output}"

result = subprocess.run(
cmd_line.split(),
Expand Down

0 comments on commit 012d613

Please sign in to comment.