diff --git a/src/openfermion/chem/pubchem_test.py b/src/openfermion/chem/pubchem_test.py index a1d97a86e..5834b337c 100644 --- a/src/openfermion/chem/pubchem_test.py +++ b/src/openfermion/chem/pubchem_test.py @@ -12,9 +12,11 @@ """Tests for pubchem.py.""" +import os + import numpy -import pytest import pubchempy +import pytest from openfermion.chem.pubchem import geometry_from_pubchem from openfermion.testing.testing_utils import module_importable @@ -149,6 +151,11 @@ def test_water_2d(self, monkeypatch): with pytest.raises(ValueError, match='Incorrect value for the argument structure'): _ = geometry_from_pubchem('water', structure='foo') + # Skip if running in a CI environment. + @pytest.mark.skipif( + 'CI' in os.environ, + reason='Skipping Pubchem API tests in CI to avoid failures due to busy servers.', + ) @pytest.mark.flaky(retries=8, delay=30, only_on=[pubchempy.ServerBusyError]) def test_geometry_from_pubchem_live_api(self): water_geometry = geometry_from_pubchem('water')