@@ -171,15 +171,16 @@ def test_ignore_hostname_glob():
171
171
assert len (xray_recorder .current_segment ().subsegments ) == 0
172
172
173
173
174
- class TestClass (httplib .HTTPSConnection ):
174
+ class CustomHttpsConnection (httplib .HTTPSConnection ):
175
175
pass
176
176
177
177
178
178
def test_ignore_subclass ():
179
179
from aws_xray_sdk .ext .httplib import add_ignored
180
180
path = '/status/200'
181
- add_ignored (subclass = 'TestClass' )
182
- conn = TestClass (BASE_URL )
181
+ subclass = 'tests.ext.httplib.test_httplib.CustomHttpsConnection'
182
+ add_ignored (subclass = subclass )
183
+ conn = CustomHttpsConnection (BASE_URL )
183
184
conn .request ('GET' , path )
184
185
conn .getresponse ()
185
186
assert len (xray_recorder .current_segment ().subsegments ) == 0
@@ -188,8 +189,9 @@ def test_ignore_subclass():
188
189
def test_ignore_multiple_match ():
189
190
from aws_xray_sdk .ext .httplib import add_ignored
190
191
path = '/status/200'
191
- add_ignored (subclass = 'TestClass' , hostname = BASE_URL )
192
- conn = TestClass (BASE_URL )
192
+ subclass = 'tests.ext.httplib.test_httplib.CustomHttpsConnection'
193
+ add_ignored (subclass = subclass , hostname = BASE_URL )
194
+ conn = CustomHttpsConnection (BASE_URL )
193
195
conn .request ('GET' , path )
194
196
conn .getresponse ()
195
197
assert len (xray_recorder .current_segment ().subsegments ) == 0
@@ -198,8 +200,9 @@ def test_ignore_multiple_match():
198
200
def test_ignore_multiple_no_match ():
199
201
from aws_xray_sdk .ext .httplib import add_ignored
200
202
path = '/status/200'
201
- add_ignored (subclass = 'TestClass' , hostname = 'fake.host' )
202
- conn = TestClass (BASE_URL )
203
+ subclass = 'tests.ext.httplib.test_httplib.CustomHttpsConnection'
204
+ add_ignored (subclass = subclass , hostname = 'fake.host' )
205
+ conn = CustomHttpsConnection (BASE_URL )
203
206
conn .request ('GET' , path )
204
207
conn .getresponse ()
205
208
assert len (xray_recorder .current_segment ().subsegments ) > 0
0 commit comments