Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/openfermion/chem/pubchem_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -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
Expand Down Expand Up @@ -74,6 +76,12 @@
module_importable('pubchempy') is False, reason='Not detecting `pubchempy`.'
)

# Skip if running in a CI environment.
skip_in_ci = pytest.mark.skipif(
Comment thread
mhucka marked this conversation as resolved.
Outdated
os.environ.get('CI'),
reason='Skipping Pubchem API tests in CI to avoid failures due to busy servers.',
)


@using_pubchempy
class TestOpenFermionPubChem:
Expand Down Expand Up @@ -149,6 +157,7 @@
with pytest.raises(ValueError, match='Incorrect value for the argument structure'):
_ = geometry_from_pubchem('water', structure='foo')

@skip_in_ci
@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')
Expand Down
Loading