mirror of
https://github.com/sprockets/sprockets.clients.dynamodb.git
synced 2024-11-23 11:19:54 +00:00
Skip the ConnectionError test in Python 2.7
This commit is contained in:
parent
1ab58a01be
commit
26f4030438
1 changed files with 5 additions and 9 deletions
|
@ -1,7 +1,9 @@
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
|
import unittest
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
|
@ -11,14 +13,7 @@ from tornado import testing
|
||||||
from tornado_aws import exceptions as aws_exceptions
|
from tornado_aws import exceptions as aws_exceptions
|
||||||
|
|
||||||
from sprockets.clients import dynamodb
|
from sprockets.clients import dynamodb
|
||||||
from sprockets.clients.dynamodb import exceptions
|
from sprockets.clients.dynamodb import connector, exceptions
|
||||||
|
|
||||||
# Stub ConnectionError for Python 2.7 that doesn't support it
|
|
||||||
try:
|
|
||||||
ConnectionError
|
|
||||||
except NameError:
|
|
||||||
class ConnectionError(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class AsyncTestCase(testing.AsyncTestCase):
|
class AsyncTestCase(testing.AsyncTestCase):
|
||||||
|
@ -118,7 +113,8 @@ class AWSClientTests(AsyncTestCase):
|
||||||
with self.assertRaises(exceptions.RequestException):
|
with self.assertRaises(exceptions.RequestException):
|
||||||
yield self.client.create_table(self.generic_table_definition())
|
yield self.client.create_table(self.generic_table_definition())
|
||||||
|
|
||||||
|
@unittest.skipIf(sys.version_info.major < 3,
|
||||||
|
'ConnectionError is Python3 only')
|
||||||
@testing.gen_test
|
@testing.gen_test
|
||||||
def test_connection_error_request_exception(self):
|
def test_connection_error_request_exception(self):
|
||||||
with mock.patch('tornado_aws.client.AsyncAWSClient.fetch') as fetch:
|
with mock.patch('tornado_aws.client.AsyncAWSClient.fetch') as fetch:
|
||||||
|
|
Loading…
Reference in a new issue