diff --git a/tests/api_tests.py b/tests/api_tests.py index 4a5fb9a..1a90c8f 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -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: