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

cleanup: known test fault, codeql #423

Merged
merged 1 commit into from
Aug 14, 2023
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
27 changes: 21 additions & 6 deletions qcengine/programs/tests/test_ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_simple_ghost(driver, program, basis, keywords, hene):

if program == "gamess":
with pytest.raises(qcng.exceptions.InputError) as e:
res = qcng.compute(resi, program, raise_error=True, return_dict=True)
qcng.compute(resi, program, raise_error=True, return_dict=True)
pytest.xfail("no ghosts with gamess")

res = qcng.compute(resi, program, raise_error=True, return_dict=True)
Expand Down Expand Up @@ -291,9 +291,24 @@ def test_atom_labels(qcprog, basis, keywords):
assert compare(nmo, atres.properties.calcinfo_nmo, label="nmo"), f"nmo: {atres.properties.calcinfo_nmo} != {nmo}"

scf = -1.656138508
assert compare_values(
scf, atres.properties.scf_total_energy, atol=3.0e-6, label="scf ene"
), f"scf ene: {atres.properties.scf_total_energy} != {scf}"

scf_alt = -1.705577613 # some versions of NWChem land on this value
mp2 = -1.7926264513
assert compare_values(mp2, atres.return_result, atol=3.0e-6, label="ene"), f"ene: {atres.return_result} != {mp2}"
mp2_alt = -1.870251459939
try:
assert compare_values(
scf, atres.properties.scf_total_energy, atol=3.0e-6, label="scf ene"
), f"scf ene: {atres.properties.scf_total_energy} != {scf}"
except AssertionError as exc:
if qcprog == "nwchem":
assert compare_values(
scf_alt, atres.properties.scf_total_energy, atol=3.0e-6, label="scf ene"
), f"scf ene: {atres.properties.scf_total_energy} != {scf_alt}"
assert compare_values(
mp2_alt, atres.return_result, atol=3.0e-6, label="ene"
), f"ene: {atres.return_result} != {mp2_alt}"
else:
raise AssertionError from exc
else:
assert compare_values(
mp2, atres.return_result, atol=3.0e-6, label="ene"
), f"ene: {atres.return_result} != {mp2}"
3 changes: 2 additions & 1 deletion qcengine/programs/tests/test_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def test_psi4_interactive_task():

assert "Final Energy" in ret.stdout
assert ret.success
assert ret.extras.pop("psiapi_evaluated", False)
is_psiapi_evaluated = ret.extras.pop("psiapi_evaluated", False)
assert is_psiapi_evaluated


@using("psi4_runqcsk")
Expand Down