Coverage for gpaw/test/pw/test_smallanglecell.py: 100%

14 statements  

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

1import pytest 

2from ase import Atoms 

3from gpaw import GPAW, PW 

4 

5 

6@pytest.mark.ci 

7def test_pw_smallanglecell(in_tmp_dir): 

8 a = 3.0 

9 ec = 200 

10 h2 = Atoms('H2', [[0, 0, 0], [0, 0, 0.8]], 

11 cell=[a, a, a], pbc=1) 

12 h2.calc = GPAW(mode=PW(ec), txt='sc.txt') 

13 e0 = h2.get_potential_energy() 

14 h2.cell[1, 0] = a 

15 with pytest.warns(UserWarning): 

16 e = h2.get_potential_energy() 

17 assert abs(e - e0) < 0.001, e - e0