File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed
Expand file tree Collapse file tree 4 files changed +14
-5
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+ from mock import patch # Python 2
912
1013from aiohttp import web
1114from 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+ import mock # Python 2
25
36import django
47from aws_xray_sdk import global_sdk_config
1316class XRayConfigurationTestCase (TestCase ):
1417 def test_sampler_can_be_configured (self ):
1518 assert isinstance (settings .XRAY_RECORDER ['SAMPLER' ], LocalSampler )
16- assert isinstance (xray_recorder .sampler , LocalSampler )
19+ 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+ from mock import patch # Python 2
36
47supported_plugins = (
58 'ec2_plugin' ,
Original file line number Diff line number Diff line change 3636 testing.postgresql
3737 testing.mysqld
3838 webtest
39- mock
39+ mock ; python_version < '3.3'
4040
4141 # Python2 only deps
4242 py{27}: enum34
You can’t perform that action at this time.
0 commit comments