Skip to content

Commit 7e35d90

Browse files
add some debugging to abinit tests
1 parent e7f2653 commit 7e35d90

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/abinit/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ def check_run_abi(ref_path: str | Path):
126126

127127
user = AbinitInputFile.from_file("run.abi")
128128
assert user.ndtset == 1, f"'run.abi' has multiple datasets (ndtset={user.ndtset})."
129-
with zopen(ref_path / "inputs" / "run.abi.gz") as file:
129+
with zopen(ref_path / "inputs" / "run.abi.gz", "rt", encoding="utf-8") as file:
130130
ref_str = file.read()
131-
ref = AbinitInputFile.from_string(ref_str.decode("utf-8"))
131+
ref = AbinitInputFile.from_string(ref_str)
132132
# Ignore the pseudos as the directory depends on the pseudo root directory
133133
diffs = user.get_differences(ref, ignore_vars=["pseudos"])
134134
# TODO: should we still add some check on the pseudos here ?
135-
assert diffs == [], "'run.abi' is different from reference."
135+
assert diffs == [], f"'run.abi' is different from reference:\n{diffs}"
136136

137137

138138
def check_abinit_input_json(ref_path: str | Path):

0 commit comments

Comments
 (0)