Skip to content

Commit 8178ba0

Browse files
authored
Improved Tornado Tests (#157)
* Use tornado loop directly and consistently * Validate span names earlier * Add helpers to search for spans in lists * Use builtin assert tools
1 parent a4d278c commit 8178ba0

File tree

2 files changed

+157
-96
lines changed

2 files changed

+157
-96
lines changed

tests/helpers.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,17 @@
5151
testenv['redis_url']= os.environ['REDIS']
5252
else:
5353
testenv['redis_url'] = '127.0.0.1:6379'
54+
55+
56+
def get_first_span_by_name(spans, name):
57+
for span in spans:
58+
if span.n == name:
59+
return span
60+
return None
61+
62+
63+
def get_span_by_filter(spans, filter):
64+
for span in spans:
65+
if filter(span) is True:
66+
return span
67+
return None

0 commit comments

Comments
 (0)