Skip to content

Commit

Permalink
add commments and break case
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonBurns committed Mar 21, 2023
1 parent 278e347 commit eb4f1aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,17 @@ def test_performance(self):
smiles_strings = []
pubchempy_start = time.time()
for compound in self.compound_list:
# HTTP errors can happen
for attempt in range(3):
try:
result = get_compounds(compound, "name")
break
except PubChemHTTPError:
pass
# could possibly never get server access
if attempt == 2:
smiles_strings.append(None)
continue
try:
smiles_strings.append(result[0].isomeric_smiles)
except IndexError:
Expand Down

0 comments on commit eb4f1aa

Please sign in to comment.