Coverage for gpaw/test/test_atoms_too_close.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.7.1, created at 2025-07-08 00:17 +0000

1import pytest 

2from ase import Atoms 

3from gpaw import GPAW 

4from gpaw.utilities import AtomsTooClose 

5 

6 

7def test_atoms_too_close(): 

8 atoms = Atoms('H2', [(0.0, 0.0, 0.0), 

9 (0.0, 0.0, 3.995)], 

10 cell=(4, 4, 4), pbc=True) 

11 

12 calc = GPAW(mode='fd', txt=None) 

13 atoms.calc = calc 

14 

15 with pytest.raises(AtomsTooClose): 

16 atoms.get_potential_energy()