Skip the ConnectionError test in Python 2.7

This commit is contained in:
Gavin M. Roy 2016-06-14 12:26:54 -04:00
parent 1ab58a01be
commit 26f4030438

View file

@ -1,7 +1,9 @@
import datetime
import os
import socket
import sys
import uuid
import unittest
import mock
@ -11,14 +13,7 @@ from tornado import testing
from tornado_aws import exceptions as aws_exceptions
from sprockets.clients import dynamodb
from sprockets.clients.dynamodb import exceptions
# Stub ConnectionError for Python 2.7 that doesn't support it
try:
ConnectionError
except NameError:
class ConnectionError(Exception):
pass
from sprockets.clients.dynamodb import connector, exceptions
class AsyncTestCase(testing.AsyncTestCase):
@ -118,7 +113,8 @@ class AWSClientTests(AsyncTestCase):
with self.assertRaises(exceptions.RequestException):
yield self.client.create_table(self.generic_table_definition())
@unittest.skipIf(sys.version_info.major < 3,
'ConnectionError is Python3 only')
@testing.gen_test
def test_connection_error_request_exception(self):
with mock.patch('tornado_aws.client.AsyncAWSClient.fetch') as fetch: