diff --git a/pymatgen/analysis/defects/supercells.py b/pymatgen/analysis/defects/supercells.py index 89a72168..aaa84203 100644 --- a/pymatgen/analysis/defects/supercells.py +++ b/pymatgen/analysis/defects/supercells.py @@ -65,7 +65,7 @@ def get_matched_structure_mapping_old( uc_struct: Structure, sc_struct: Structure, sm: StructureMatcher | None = None, -) -> tuple[NDArray, ArrayLike] | None: +) -> tuple[NDArray, ArrayLike] | None: # pragma: no cover """Get the mapping of the supercell to the unit cell. Get the mapping from the supercell structure onto the base structure, diff --git a/tests/test_supercells.py b/tests/test_supercells.py index bd12a4ca..1ef169a7 100644 --- a/tests/test_supercells.py +++ b/tests/test_supercells.py @@ -7,6 +7,7 @@ get_sc_fromstruct, get_closest_sc_mat ) +import pytest def test_supercells(gan_struct): @@ -28,6 +29,9 @@ def test_ase_supercells(gan_struct): sc = gan_struct * sc_mat assert 4 <= sc.num_sites <= 8 + # check raise + with pytest.raises(RuntimeError): + _ase_cubic(gan_struct, min_atoms=4, max_atoms=8, min_length=10) def test_closest_sc_mat(test_dir):