File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed
Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 55"""
66import asyncio
77from aws_xray_sdk import global_sdk_config
8- from unittest .mock import patch
8+ try :
9+ from unittest .mock import patch
10+ except ImportError :
11+ # NOTE: Python 2 dependency
12+ from mock import patch
913
1014from aiohttp import web
1115from aiohttp .web_exceptions import HTTPUnauthorized
Original file line number Diff line number Diff line change 1- from unittest import mock
1+ try :
2+ from unittest import mock
3+ except ImportError :
4+ # NOTE: Python 2 dependency
5+ import mock
26
37import django
48from aws_xray_sdk import global_sdk_config
1317class XRayConfigurationTestCase (TestCase ):
1418 def test_sampler_can_be_configured (self ):
1519 assert isinstance (settings .XRAY_RECORDER ['SAMPLER' ], LocalSampler )
16- assert isinstance (xray_recorder .sampler , LocalSampler )
20+ assert isinstance (xray_recorder .sampler , LocalSampler )
Original file line number Diff line number Diff line change 11from aws_xray_sdk .core .plugins .utils import get_plugin_modules
2- from mock import patch
2+ try :
3+ from unittest .mock import patch
4+ except ImportError :
5+ # NOTE: Python 2 dependency
6+ from mock import patch
37
48supported_plugins = (
59 'ec2_plugin' ,
Original file line number Diff line number Diff line change @@ -36,10 +36,8 @@ deps =
3636 testing.postgresql
3737 testing.mysqld
3838 webtest
39- mock
40-
4139 # Python2 only deps
42- py{27}: enum34
40+ py{27}: enum34 mock
4341
4442 # pymysql deps
4543 py{27,34,35}: pymysql < 1.0.0
You can’t perform that action at this time.
0 commit comments