From eb4f1aa21ad9438f85983c7eaef2e7414b7691e9 Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Tue, 21 Mar 2023 11:34:09 -0400 Subject: [PATCH] add commments and break case --- test/test_performance.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_performance.py b/test/test_performance.py index b115d6d..205dbd4 100644 --- a/test/test_performance.py +++ b/test/test_performance.py @@ -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: