Skip to content

Commit 5b5ec1e

Browse files
committed
Move to Python 3.3+ mock import
1 parent 15cc2df commit 5b5ec1e

8 files changed

+8
-20
lines changed

tests/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@
1919

2020

2121
import unittest
22-
23-
24-
# Python 3 includes mocking, while 2 requires an extra module.
25-
if sys.version_info[0] == 2:
26-
import mock
27-
else:
28-
from unittest import mock
22+
from unittest import mock
2923

3024

3125
# In python 3, order matters when calling assertEqual to

tests/unit/docs/test_docstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
import mock
1413
from botocore.compat import six
1514

1615
from tests.unit.docs import BaseDocsTest
16+
from tests import mock
1717

1818

1919
class TestResourceDocstrings(BaseDocsTest):

tests/unit/docs/test_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
import os
14-
import mock
1514

1615
import boto3
16+
from tests import mock
1717
from tests.unit.docs import BaseDocsTest
1818
from boto3.docs.service import ServiceDocumenter
1919

tests/unit/ec2/test_createtags.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
# distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
from tests import unittest
14-
import mock
13+
from tests import mock, unittest
1514

1615
import boto3.session
1716
from boto3.ec2 import createtags

tests/unit/ec2/test_deletetags.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
# distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
import unittest
14-
import mock
13+
from tests import mock, unittest
1514

1615
from boto3.ec2.deletetags import delete_tags
1716

tests/unit/s3/test_inject.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010
# distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
import mock
14-
1513
from botocore.exceptions import ClientError
1614
from botocore.compat import six
1715

1816
from boto3.s3 import inject
19-
from tests import unittest
17+
from tests import mock, unittest
2018

2119

2220
class TestInjectTransferMethods(unittest.TestCase):

tests/unit/s3/test_transfer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
# distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
from tests import unittest
13+
from tests import mock, unittest
1414

15-
import mock
1615
from s3transfer.manager import TransferManager
1716
from s3transfer.futures import NonThreadedExecutor
1817

tests/unit/test_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
import types
14-
from tests import unittest
15-
import mock
14+
from tests import mock, unittest
1615

1716
from boto3 import utils
1817

0 commit comments

Comments
 (0)