Coverage for gpaw/test/sic/test_pz_localization_pw.py: 100%

10 statements  

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

1import pytest 

2 

3from gpaw import GPAW 

4 

5 

6@pytest.mark.old_gpaw_only 

7@pytest.mark.sic 

8def test_pz_localization_pw(in_tmp_dir, gpw_files): 

9 """ 

10 Test Perdew-Zunger and Kohn-Sham localizations in PW mode 

11 :param in_tmp_dir: 

12 :return: 

13 """ 

14 calc = GPAW(gpw_files["h2o_pz_localization_pw"]) 

15 H2O = calc.atoms 

16 H2O.calc = calc 

17 e = H2O.get_potential_energy() 

18 assert e == pytest.approx(-10.118236, abs=0.1)