Skip to content

Commit 05ed4ee

Browse files
fix tests to work with fake potcar library
1 parent cb6670a commit 05ed4ee

File tree

16 files changed

+8
-7
lines changed

16 files changed

+8
-7
lines changed

pymatgen/io/validation/check_incar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
from pydantic import Field
66

7-
from pymatgen.io.validation.common import SETTINGS, BaseValidator, VaspFiles
7+
from pymatgen.io.validation.common import SETTINGS, BaseValidator
88
from pymatgen.io.validation.vasp_defaults import InputCategory, VaspParam
99

1010
from typing import TYPE_CHECKING

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22
import pytest
33

44
from monty.serialization import loadfn
5+
from pymatgen.core import SETTINGS as PMG_SETTINGS
6+
57
from pymatgen.io.validation.common import VaspFiles
68

79
_test_dir = Path(__file__).parent.joinpath("test_files").resolve()
810

11+
FAKE_POTCAR_DIR = _test_dir / "vasp" / "fake_potcar"
12+
pytest.MonkeyPatch().setitem(PMG_SETTINGS, "PMG_VASP_PSP_DIR", str(FAKE_POTCAR_DIR))
913

1014
@pytest.fixture(scope="session")
1115
def test_dir():
1216
return _test_dir
1317

14-
1518
vasp_calc_data: dict[str, VaspFiles] = {
1619
k: VaspFiles(**loadfn(_test_dir / "vasp" / f"{k}.json.gz"))
1720
for k in ("Si_uniform", "Si_static", "Si_old_double_relax")
1821
}
1922

20-
2123
def incar_check_list():
2224
"""Pre-defined list of pass/fail tests."""
2325
return loadfn(_test_dir / "vasp" / "scf_incar_check_list.yaml")
-17 Bytes
Binary file not shown.
-207 Bytes
Binary file not shown.
-18 Bytes
Binary file not shown.
580 Bytes
Binary file not shown.
68.1 KB
Binary file not shown.
96.2 KB
Binary file not shown.
117 KB
Binary file not shown.
56.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)