Coverage for gpaw/test/sic/test_scfsic_h2.py: 100%
15 statements
« prev ^ index » next coverage.py v7.7.1, created at 2025-07-14 00:18 +0000
« prev ^ index » next coverage.py v7.7.1, created at 2025-07-14 00:18 +0000
1import pytest
3from gpaw import GPAW
6@pytest.mark.old_gpaw_only
7@pytest.mark.sic
8def test_sic_scfsic_h2(in_tmp_dir, gpw_files):
9 calc = GPAW(gpw_files["h2_sic_scfsic"])
10 H2 = calc.atoms
11 H2.calc = calc
12 calc_H = GPAW(gpw_files["h_magmom"])
13 H = calc_H.atoms
14 H.calc = calc_H
15 e1 = H.get_potential_energy()
16 e2 = H2.get_potential_energy()
17 de = 2 * e1 - e2
18 # Used to be a commented out abs=0.1
19 assert de == pytest.approx(4.5, abs=0.4)
20 # Test forces ...