Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit ec2ed1c

Browse files
authored
Unpin test dependencies (#308)
* Unpin test dependencies Signed-off-by: Yuri Shkuro <[email protected]> * Fix tests Signed-off-by: Yuri Shkuro <[email protected]>
1 parent 2533be7 commit ec2ed1c

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

setup.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@
4848
test_suite='tests',
4949
extras_require={
5050
'tests': [
51-
'mock==1.0.1',
52-
'pycurl>=7.43,<8',
53-
# pinned to avoid RemovedInPytest4Warning
54-
'pytest>=3.7.0,<3.8.0',
55-
'pytest-cov==2.5.1',
56-
'coverage<4.4', # can remove after https://bitbucket.org/ned/coveragepy/issues/581/44b1-44-breaking-in-ci
57-
'pytest-timeout==1.3.1',
51+
'mock',
52+
'pycurl',
53+
'pytest',
54+
'pytest-cov',
55+
'coverage',
56+
'pytest-timeout',
5857
'pytest-tornado',
59-
# pin <3.2 as otherwise it requires pytest>=3.8
60-
'pytest-benchmark[histogram]>=3.0.0rc1,<3.2',
58+
'pytest-benchmark[histogram]',
6159
'pytest-localserver',
6260
'flake8',
6361
'flake8-quotes',

tests/test_tracer.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_start_trace(tracer):
5656

5757
span.finish()
5858
assert span.end_time is not None, 'Must have end_time defined'
59-
tracer.reporter.assert_called_once()
59+
tracer.reporter.report_span.assert_called_once()
6060

6161
tracer.close()
6262

@@ -84,7 +84,7 @@ def test_start_child(tracer, mode):
8484
assert span.parent_id == root.span_id, 'Must inherit parent id'
8585
span.finish()
8686
assert span.end_time is not None, 'Must have end_time set'
87-
tracer.reporter.assert_called_once()
87+
tracer.reporter.report_span.assert_called_once()
8888
tracer.close()
8989

9090

@@ -113,7 +113,7 @@ def test_child_span(tracer):
113113
child.log_event('kiss-my-shiny-metal-...')
114114
child.finish()
115115
span.finish()
116-
tracer.reporter.report_span.assert_called_once()
116+
tracer.reporter.report_span.assert_called()
117117
assert len(span.logs) == 0, 'Parent span is Local, must not have events'
118118
assert len(child.logs) == 1, 'Child must have one events'
119119

@@ -138,27 +138,29 @@ def test_follows_from(tracer):
138138
span.finish()
139139
span1.finish()
140140
follow_span.finish()
141-
tracer.reporter.report_span.assert_called_once()
141+
tracer.reporter.report_span.assert_called()
142142
assert len(follow_span.references) == 2
143143
assert follow_span.context.parent_id == span.context.span_id
144144
for reference in follow_span.references:
145145
assert reference.referenced_context is not None
146146

147+
tracer.reporter = mock.MagicMock()
147148
span = tracer.start_span('test')
148149
follow_span = tracer.start_span(references=follows_from(span.context))
149150
span.finish()
150151
follow_span.finish()
151-
tracer.reporter.report_span.assert_called_once()
152+
tracer.reporter.report_span.assert_called()
152153
assert isinstance(follow_span.references, list)
153154

155+
tracer.reporter = mock.MagicMock()
154156
span = tracer.start_span('test')
155157
parent_span = tracer.start_span('test-parent')
156158
child_span = tracer.start_span('test-child', child_of=parent_span,
157159
references=follows_from(span.context))
158160
span.finish()
159161
parent_span.finish()
160162
child_span.finish()
161-
tracer.reporter.report_span.assert_called_once()
163+
tracer.reporter.report_span.assert_called()
162164
assert child_span.context.parent_id == parent_span.context.span_id
163165
assert len(child_span.references) == 1
164166
tracer.close()

0 commit comments

Comments
 (0)