Skip to content

Commit

Permalink
Skip test case stdlib ConnectionError on Python 2
Browse files Browse the repository at this point in the history
Co-authored-by: Tres Seaver <[email protected]>
  • Loading branch information
cojenco and tseaver authored May 19, 2021
1 parent 14706e7 commit bcfe2be
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/unit/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,13 @@ def test_w_requests_connection_error(self):
exc = ValueError("testing")
self.assertFalse(self._call_fut(exc))

@unittest.skipUnless(
"ConnectionError" in __builtins__.__dict__,
"No builtin 'ConnectionError' in Python 2",
)
def test_w_stdlib_connection_error(self):
from google.cloud.storage import retry

try:
exc = ConnectionError()
self.assertTrue(self._call_fut(exc))
self.assertTrue(ConnectionError in retry._RETRYABLE_TYPES)
except NameError:
pass

exc = ConnectionError()
self.assertTrue(self._call_fut(exc))

class TestConditionalRetryPolicy(unittest.TestCase):
def _make_one(self, retry_policy, conditional_predicate, required_kwargs):
Expand Down

0 comments on commit bcfe2be

Please sign in to comment.