Skip to content

Commit b84bae1

Browse files
Update src/openfermion/chem/molecular_data_test.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 6e6e541 commit b84bae1

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/openfermion/chem/molecular_data_test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,16 +356,15 @@ def test_load_no_general_calculations(self):
356356
basis = '6-31g*'
357357
multiplicity = 1
358358
molecule = MolecularData(geometry, basis, multiplicity, filename=filename)
359-
molecule.save()
359+
try:
360+
molecule.save()
360361

361-
# Manually remove the general_calculations_keys dataset.
362-
with h5py.File(filename + '.hdf5', 'r+') as f:
363-
del f['general_calculations_keys']
362+
# Manually remove the general_calculations_keys dataset.
363+
with h5py.File(filename + '.hdf5', 'r+') as f:
364+
del f['general_calculations_keys']
364365

365-
try:
366-
# Load the molecule and check that general_calculations is None.
366+
# Load the molecule and check that general_calculations is empty.
367367
new_molecule = MolecularData(filename=filename)
368-
new_molecule.load()
369-
self.assertIsNone(new_molecule.general_calculations)
368+
self.assertEqual(new_molecule.general_calculations, {})
370369
finally:
371370
os.remove(filename + '.hdf5')

0 commit comments

Comments
 (0)