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

Refactor tests to match new signature #4

Merged
merged 1 commit into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 12 additions & 10 deletions bep_pcb_check/tests/test_beppcb_acis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
RegressionTester, all_loads
import pytest

beppcb_rt = RegressionTester(BEPPCBCheck, model_path, "bep_pcb_test_spec.json")

# ACIS state builder tests

beppcb_rt.run_models(state_builder='acis')
@pytest.fixture(autouse=True, scope='module')
def bp_rt(test_root):
# ACIS state builder tests
rt = RegressionTester(BEPPCBCheck, model_path,
"bep_pcb_test_spec.json",
test_root=test_root, sub_dir='acis')
rt.run_models(state_builder='acis')
return rt

# Prediction tests


@pytest.mark.parametrize('load', all_loads)
def test_prediction(answer_store, load):
beppcb_rt.run_test("prediction", load, answer_store=answer_store)
def test_prediction(bp_rt, answer_store, load):
bp_rt.run_test("prediction", load, answer_store=answer_store)

# Validation tests


@pytest.mark.parametrize('load', all_loads)
def test_validation(answer_store, load):
beppcb_rt.run_test("validation", load, answer_store=answer_store)
def test_validation(bp_rt, answer_store, load):
bp_rt.run_test("validation", load, answer_store=answer_store)
22 changes: 12 additions & 10 deletions bep_pcb_check/tests/test_beppcb_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,30 @@
import pytest


beppcb_rt = RegressionTester(BEPPCBCheck, model_path, "bep_pcb_test_spec.json")

# SQL state builder tests

beppcb_rt.run_models(state_builder='sql')
@pytest.fixture(autouse=True, scope='module')
def bp_rt(test_root):
# SQL state builder tests
rt = RegressionTester(BEPPCBCheck, model_path,
"bep_pcb_test_spec.json",
test_root=test_root, sub_dir='sql')
rt.run_models(state_builder='sql')
return rt

# Prediction tests


@pytest.mark.parametrize('load', all_loads)
def test_prediction(answer_store, load):
def test_prediction(bp_rt, answer_store, load):
if not answer_store:
beppcb_rt.run_test("prediction", load)
bp_rt.run_test("prediction", load)
else:
pass

# Validation tests


@pytest.mark.parametrize('load', all_loads)
def test_validation(answer_store, load):
def test_validation(bp_rt, answer_store, load):
if not answer_store:
beppcb_rt.run_test("validation", load)
bp_rt.run_test("validation", load)
else:
pass
7 changes: 4 additions & 3 deletions bep_pcb_check/tests/test_beppcb_viols.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
RegressionTester
import os

beppcb_rt = RegressionTester(BEPPCBCheck, model_path, "bep_pcb_test_spec.json")


def test_JUL3019A_viols(answer_store):
def test_JUL3019A_viols(answer_store, test_root):
answer_data = os.path.join(os.path.dirname(__file__), "answers",
"JUL2919A_viol.json")
beppcb_rt = RegressionTester(BEPPCBCheck, model_path,
"bep_pcb_test_spec.json",
test_root=test_root, sub_dir='viols')
beppcb_rt.check_violation_reporting("JUL2919A", answer_data,
answer_store=answer_store)