1from ase import Atoms 2from gpaw import GPAW 3import numpy as np 4 5 6def test_atoms_too_close(): 7 atoms = Atoms('H2', [(0.0, 0.0, 0.0), 8 (0.0, 0.0, 3.995)], 9 cell=(4, 4, 4), pbc=True) 10 11 calc = GPAW(txt=None) 12 atoms.calc = calc 13 try: 14 calc.initialize(atoms) 15 calc.set_positions(atoms) 16 except RuntimeError as err: 17 print('got error as expected: {}'.format(err)) 18 else: 19 # silly exception where we actually skip the check for older numpies 20 if hasattr(np, 'divmod'): 21 assert 2 + 2 == 5 22