Skip to content

Commit 2efe37d

Browse files
polamaysterBohdan Kuzema
authored and
Bohdan Kuzema
committed
[iss-167] X-RAY creates new session, added empty creds for botocore version before signature_version=UNSIGNED
1 parent cdffa0d commit 2efe37d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

tests/test_recorder.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import platform
2-
try:
3-
from unittest.mock import patch
4-
except ImportError:
5-
from mock import patch
62

73
import pytest
84

@@ -14,16 +10,15 @@
1410
from aws_xray_sdk.core.models.subsegment import Subsegment
1511
from aws_xray_sdk.core.models.dummy_entities import DummySegment, DummySubsegment
1612

17-
with patch("aws_xray_sdk.core.sampling.connector.botocore.session.Session.get_credentials") as get_credentials:
18-
xray_recorder = get_new_stubbed_recorder()
19-
assert not get_credentials.called
13+
xray_recorder = get_new_stubbed_recorder()
2014

2115

2216
@pytest.fixture(autouse=True)
23-
def construct_ctx():
17+
def construct_ctx(monkeypatch):
2418
"""
2519
Clean up context storage before and after each test run.
2620
"""
21+
monkeypatch.delattr("botocore.session.Session.get_credentials")
2722
xray_recorder.configure(sampling=False)
2823
xray_recorder.clear_trace_entities()
2924
yield

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ deps =
2727

2828
# Python2 only deps
2929
py{27}: enum34
30-
py{27}: mock
3130

3231
# Python3.5+ only deps
3332
py{35,36,37}: aiohttp >= 3.0.0

0 commit comments

Comments
 (0)