We have three tests that rely on the pubchempy module for retrieving data from the PubChem db:
- ExamplesTest.test_can_run_examples_jupyter_notebooks,
- OpenFermionPubChemTest.test_helium,
- OpenFermionPubChemTest.test_water,
defined in
- src/openfermion/tests/_examples_test.py,
- src/openfermion/utils/_pubchem_test.py.
Since pubchempy makes outbound network connections, the tests sometimes fail for reasons unrelated to the code they are meant exercise. For example, see #480 where judging by the error code errno=99 (aka EADDRNOTAVAIL) which we got back in the URLError exception the failure appears to be due to local port number exhaustion.
Probably the best way to fix this is to use dependency injection and local datasets (retrieved from PubChem manually and stored alongside the tests).