Skip to content

Commit f275761

Browse files
authored
Merge branch '0.24-dev' into celery-43
2 parents 69cd82e + 30466fa commit f275761

File tree

12 files changed

+18
-16
lines changed

12 files changed

+18
-16
lines changed

ddtrace/contrib/pyramid/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def insert_tween_if_needed(settings):
7878
# pyramid. We need our tween to be before it, otherwise unhandled
7979
# exceptions will be caught before they reach our tween.
8080
idx = tweens.find(pyramid.tweens.EXCVIEW)
81-
if idx is -1:
81+
if idx == -1:
8282
settings['pyramid.tweens'] = tweens + '\n' + DD_TWEEN_NAME
8383
else:
8484
settings['pyramid.tweens'] = tweens[:idx] + DD_TWEEN_NAME + "\n" + tweens[idx:]

ddtrace/contrib/tornado/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def notify(self):
5858
'analytics_enabled': False,
5959
'settings': {
6060
'FILTERS': [
61-
FilterRequestsOnUrl(r'http://test\.example\.com'),
61+
FilterRequestsOnUrl(r'http://test\\.example\\.com'),
6262
],
6363
},
6464
},

ddtrace/filters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class FilterRequestsOnUrl(object):
1818
1919
To filter out http calls to domain api.example.com::
2020
21-
FilterRequestsOnUrl(r'http://api\.example\.com')
21+
FilterRequestsOnUrl(r'http://api\\.example\\.com')
2222
2323
To filter out http calls to all first level subdomains from example.com::
2424
25-
FilterRequestOnUrl(r'http://.*+\.example\.com')
25+
FilterRequestOnUrl(r'http://.*+\\.example\\.com')
2626
2727
To filter out calls to both http://test.example.com and http://example.com/healthcheck::
2828
29-
FilterRequestOnUrl([r'http://test\.example\.com', r'http://example\.com/healthcheck'])
29+
FilterRequestOnUrl([r'http://test\\.example\\.com', r'http://example\\.com/healthcheck'])
3030
"""
3131
def __init__(self, regexps):
3232
if isinstance(regexps, str):

ddtrace/monkey.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def on_import(hook):
9696
def patch_all(**patch_modules):
9797
"""Automatically patches all available modules.
9898
99-
:param dict \**patch_modules: Override whether particular modules are patched or not.
99+
:param dict patch_modules: Override whether particular modules are patched or not.
100100
101101
>>> patch_all(redis=False, cassandra=False)
102102
"""
@@ -110,7 +110,7 @@ def patch(raise_errors=True, **patch_modules):
110110
"""Patch only a set of given modules.
111111
112112
:param bool raise_errors: Raise error if one patch fail.
113-
:param dict \**patch_modules: List of modules to patch.
113+
:param dict patch_modules: List of modules to patch.
114114
115115
>>> patch(psycopg=True, elasticsearch=True)
116116
"""

ddtrace/pin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def service(self):
4848
return self._config['service_name']
4949

5050
def __setattr__(self, name, value):
51-
if getattr(self, '_initialized', False) and name is not '_target':
51+
if getattr(self, '_initialized', False) and name != '_target':
5252
raise AttributeError("can't mutate a pin, use override() or clone() instead")
5353
super(Pin, self).__setattr__(name, value)
5454

tests/contrib/dbapi/test_unit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from ddtrace import Pin
44
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
55
from ddtrace.contrib.dbapi import FetchTracedCursor, TracedCursor, TracedConnection
6+
from ddtrace.span import Span
67
from ...base import BaseTracerTestCase
78

89

tests/contrib/falcon/test_distributed_tracing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ def test_distributred_tracing_disabled(self):
4949
eq_(len(traces), 1)
5050
eq_(len(traces[0]), 1)
5151

52-
ok_(traces[0][0].parent_id is not 42)
53-
ok_(traces[0][0].trace_id is not 100)
52+
ok_(traces[0][0].parent_id != 42)
53+
ok_(traces[0][0].trace_id != 100)

tests/contrib/httplib/test_httplib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def test_httplib_request_and_response_headers(self):
351351

352352
# Enabled when configured
353353
with self.override_config('hhtplib', {}):
354+
from ddtrace.settings import IntegrationConfig
354355
integration_config = config.httplib # type: IntegrationConfig
355356
integration_config.http.trace_headers(['my-header', 'access-control-allow-origin'])
356357
conn = self.get_http_connection(SOCKET)

tests/contrib/tornado/test_stack_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ def test_propagation_without_stack_context(self):
4545
traces = self.tracer.writer.pop_traces()
4646
eq_(len(traces), 1)
4747
eq_(len(traces[0]), 1)
48-
ok_(traces[0][0].trace_id is not 100)
49-
ok_(traces[0][0].parent_id is not 101)
48+
ok_(traces[0][0].trace_id != 100)
49+
ok_(traces[0][0].parent_id != 101)

tests/opentracer/test_tracer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def test_start_active_span_child_finish_after_parent(self, ot_tracer, writer):
301301
span2.finish()
302302

303303
spans = writer.pop()
304-
assert len(spans) is 2
304+
assert len(spans) == 2
305305
assert spans[0].parent_id is None
306306
assert spans[1].parent_id is span1._dd_span.span_id
307307
assert spans[1].duration > spans[0].duration

0 commit comments

Comments
 (0)