Skip to content

Commit fe3dd2f

Browse files
committed
Fix broken unit tests and update unreleased changes
1 parent f8b65f1 commit fe3dd2f

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.pyc
33
.Python
44
.cache
5+
.pytest_cache
56
man
67

78
build

CHANGELOG.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ CHANGELOG
44

55
Unreleased
66
==========
7-
* bugfix: Fixed an issue that caused annotation keys with invalid characters to be silently ignored.
7+
* feature: Add support for SQLAlchemy and Flask-SQLAlcemy. `PR14 <https://github.com/aws/aws-xray-sdk-python/pull/14>`_.
8+
* feature: Add support for PynamoDB calls to DynamoDB. `PR13 <https://github.com/aws/aws-xray-sdk-python/pull/13>`_.
9+
* bugfix: Drop invalid annotation keys and log a warning. `PR22 <https://github.com/aws/aws-xray-sdk-python/pull/22>`_.
10+
* bugfix: Respect `with` statement on cursor objects in dbapi2 patcher. `PR17 <https://github.com/aws/aws-xray-sdk-python/pull/17>`_.
811

912
0.95
1013
====

aws_xray_sdk/ext/dbapi2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, cursor, meta={}):
3434
self._xray_meta['database_type'] = db_type
3535

3636
def __enter__(self):
37-
37+
3838
value = self.__wrapped__.__enter__()
3939
if value is not self.__wrapped__:
4040
return value

tests/ext/django/test_middleware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class XRayTestCase(TestCase):
1010

1111
def setUp(self):
1212
django.setup()
13-
xray_recorder.configure(service='test', sampling=False, context=Context())
13+
xray_recorder.configure(context=Context(),
14+
context_missing='LOG_ERROR')
1415
xray_recorder.clear_trace_entities()
1516

1617
def tearDown(self):

tests/ext/pynamodb/test_pynamodb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import pytest
33
from botocore.exceptions import ClientError
44
from pynamodb.attributes import UnicodeAttribute
5-
from pynamodb.exceptions import VerboseClientError
65
from pynamodb.models import Model
76

87
from aws_xray_sdk.core import patch
@@ -36,7 +35,7 @@ class Meta:
3635

3736
try:
3837
SampleModel.describe_table()
39-
except VerboseClientError:
38+
except Exception:
4039
pass
4140

4241
subsegments = xray_recorder.current_segment().subsegments

tests/test_trace_entities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def test_put_annotation():
5252
'key2': 'value2',
5353
}
5454
# invalid annotation key-value pair should be dropped
55-
segment.put_annotation('invalid_value', invalid)
56-
segment.put_annotation('invalid-key', invalid)
55+
segment.put_annotation('valid_key', invalid)
56+
segment.put_annotation('invalid-key', 'validvalue')
5757
segment.put_annotation('number', 1)
5858

5959
subsegment = Subsegment('sub', 'local', segment)

0 commit comments

Comments
 (0)