File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
import platform
2
- try :
3
- from unittest .mock import patch
4
- except ImportError :
5
- from mock import patch
6
2
7
3
import pytest
8
4
14
10
from aws_xray_sdk .core .models .subsegment import Subsegment
15
11
from aws_xray_sdk .core .models .dummy_entities import DummySegment , DummySubsegment
16
12
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 ()
20
14
21
15
22
16
@pytest .fixture (autouse = True )
23
- def construct_ctx ():
17
+ def construct_ctx (monkeypatch ):
24
18
"""
25
19
Clean up context storage before and after each test run.
26
20
"""
21
+ monkeypatch .delattr ("botocore.session.Session.get_credentials" )
27
22
xray_recorder .configure (sampling = False )
28
23
xray_recorder .clear_trace_entities ()
29
24
yield
Original file line number Diff line number Diff line change 27
27
28
28
# Python2 only deps
29
29
py{27}: enum34
30
- py{27}: mock
31
30
32
31
# Python3.5+ only deps
33
32
py{35,36,37}: aiohttp >= 3.0.0
You can’t perform that action at this time.
0 commit comments