diff --git a/qcengine/programs/tests/test_mrchem.py b/qcengine/programs/tests/test_mrchem.py index 8158b4af..e1caba7b 100644 --- a/qcengine/programs/tests/test_mrchem.py +++ b/qcengine/programs/tests/test_mrchem.py @@ -5,12 +5,12 @@ from qcelemental.testing import compare_values import qcengine as qcng -from qcengine.testing import using +from qcengine.testing import checkver_and_convert, schema_versions, using @pytest.fixture -def h2o(): - return qcel.models.Molecule( +def h2o(schema_versions): + return schema_versions[0].Molecule( geometry=[[0, 0, -0.1250], [-1.4375, 0, 1.0250], [1.4375, 0, 1.0250]], symbols=["O", "H", "H"], connectivity=[[0, 1, 1], [0, 2, 1]], @@ -29,14 +29,16 @@ def fh(): @using("mrchem") -def test_energy(h2o): +def test_energy(h2o, schema_versions, request): + models, _ = schema_versions + mr_kws = { "world_prec": 1.0e-3, "world_size": 6, "world_unit": "bohr", } - inp = qcel.models.AtomicInput( + inp = models.AtomicInput( molecule=h2o, driver="energy", model={ @@ -45,7 +47,9 @@ def test_energy(h2o): keywords=mr_kws, ) + inp = checkver_and_convert(inp, request.node.name, "pre") res = qcng.compute(inp, "mrchem", raise_error=True, return_dict=True) + res = checkver_and_convert(res, request.node.name, "post") # Make sure the calculation completed successfully assert compare_values(-76.4546307, res["return_result"], atol=1e-3) @@ -63,14 +67,16 @@ def test_energy(h2o): @using("mrchem") -def test_dipole(h2o): +def test_dipole(h2o, schema_versions, request): + models, _ = schema_versions + mr_kws = { "world_prec": 1.0e-3, "world_size": 6, "world_unit": "bohr", } - inp = qcel.models.AtomicInput( + inp = models.AtomicInput( molecule=h2o, driver="properties", model={ @@ -79,7 +85,9 @@ def test_dipole(h2o): keywords=mr_kws, ) + inp = checkver_and_convert(inp, request.node.name, "pre") res = qcng.compute(inp, "mrchem", raise_error=True, return_dict=True) + res = checkver_and_convert(res, request.node.name, "post") # Make sure the calculation completed successfully assert compare_values([-3.766420e-07, 0.0, 0.720473], res["return_result"]["dipole_moment"]["dip-1"], atol=1e-3) diff --git a/qcengine/programs/tests/test_xtb.py b/qcengine/programs/tests/test_xtb.py index 4ed47a83..7dbad30f 100644 --- a/qcengine/programs/tests/test_xtb.py +++ b/qcengine/programs/tests/test_xtb.py @@ -46,9 +46,9 @@ def test_xtb_task_gfn1xtb_m01(schema_versions, request): driver="gradient", ) - atomic_input = checkver_and_convert(atomic_input, request.name, "pre") + atomic_input = checkver_and_convert(atomic_input, request.node.name, "pre") atomic_result = qcng.compute(atomic_input, "xtb") - atomic_result = checkver_and_convert(atomic_result, request.name, "post") + atomic_result = checkver_and_convert(atomic_result, request.node.name, "post") assert atomic_result.success assert pytest.approx(atomic_result.return_result, abs=thr) == return_result @@ -91,9 +91,9 @@ def test_xtb_task_gfn1xtb_m02(schema_versions, request): }, ) - atomic_input = checkver_and_convert(atomic_input, request.name, "pre") + atomic_input = checkver_and_convert(atomic_input, request.node.name, "pre") atomic_result = qcng.compute(atomic_input, "xtb") - atomic_result = checkver_and_convert(atomic_result, request.name, "post") + atomic_result = checkver_and_convert(atomic_result, request.node.name, "post") assert atomic_result.success assert pytest.approx(atomic_result.return_result, abs=thr) == return_result @@ -135,9 +135,9 @@ def test_xtb_task_gfn1xtb_m03(schema_versions, request): }, ) - atomic_input = checkver_and_convert(atomic_input, request.name, "pre") + atomic_input = checkver_and_convert(atomic_input, request.node.name, "pre") atomic_result = qcng.compute(atomic_input, "xtb") - atomic_result = checkver_and_convert(atomic_result, request.name, "post") + atomic_result = checkver_and_convert(atomic_result, request.node.name, "post") assert atomic_result.success assert pytest.approx(atomic_result.return_result, abs=thr) == return_result @@ -179,9 +179,9 @@ def test_xtb_task_gfn1xtb_m04(schema_versions, request): driver="properties", ) - atomic_input = checkver_and_convert(atomic_input, request.name, "pre") + atomic_input = checkver_and_convert(atomic_input, request.node.name, "pre") atomic_result = qcng.compute(atomic_input, "xtb") - atomic_result = checkver_and_convert(atomic_result, request.name, "post") + atomic_result = checkver_and_convert(atomic_result, request.node.name, "post") assert atomic_result.success assert pytest.approx(atomic_result.return_result["dipole"], abs=thr) == return_result["dipole"] @@ -203,9 +203,9 @@ def test_xtb_task_gfn1xtb_m05(schema_versions, request): driver="energy", ) - atomic_input = checkver_and_convert(atomic_input, request.name, "pre") + atomic_input = checkver_and_convert(atomic_input, request.node.name, "pre") atomic_result = qcng.compute(atomic_input, "xtb") - atomic_result = checkver_and_convert(atomic_result, request.name, "post") + atomic_result = checkver_and_convert(atomic_result, request.node.name, "post") assert atomic_result.success assert pytest.approx(atomic_result.return_result, abs=thr) == return_result @@ -245,9 +245,9 @@ def test_xtb_task_gfn2xtb_m01(schema_versions, request): driver="gradient", ) - atomic_input = checkver_and_convert(atomic_input, request.name, "pre") + atomic_input = checkver_and_convert(atomic_input, request.node.name, "pre") atomic_result = qcng.compute(atomic_input, "xtb") - atomic_result = checkver_and_convert(atomic_result, request.name, "post") + atomic_result = checkver_and_convert(atomic_result, request.node.name, "post") assert atomic_result.success assert pytest.approx(atomic_result.return_result, abs=thr) == return_result