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

Commit

Permalink
Unpin test dependencies (#308)
Browse files Browse the repository at this point in the history
* Unpin test dependencies

Signed-off-by: Yuri Shkuro <[email protected]>

* Fix tests

Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro authored May 15, 2021
1 parent 2533be7 commit ec2ed1c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 7 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@
test_suite='tests',
extras_require={
'tests': [
'mock==1.0.1',
'pycurl>=7.43,<8',
# pinned to avoid RemovedInPytest4Warning
'pytest>=3.7.0,<3.8.0',
'pytest-cov==2.5.1',
'coverage<4.4', # can remove after https://bitbucket.org/ned/coveragepy/issues/581/44b1-44-breaking-in-ci
'pytest-timeout==1.3.1',
'mock',
'pycurl',
'pytest',
'pytest-cov',
'coverage',
'pytest-timeout',
'pytest-tornado',
# pin <3.2 as otherwise it requires pytest>=3.8
'pytest-benchmark[histogram]>=3.0.0rc1,<3.2',
'pytest-benchmark[histogram]',
'pytest-localserver',
'flake8',
'flake8-quotes',
Expand Down
14 changes: 8 additions & 6 deletions tests/test_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_start_trace(tracer):

span.finish()
assert span.end_time is not None, 'Must have end_time defined'
tracer.reporter.assert_called_once()
tracer.reporter.report_span.assert_called_once()

tracer.close()

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


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

Expand All @@ -138,27 +138,29 @@ def test_follows_from(tracer):
span.finish()
span1.finish()
follow_span.finish()
tracer.reporter.report_span.assert_called_once()
tracer.reporter.report_span.assert_called()
assert len(follow_span.references) == 2
assert follow_span.context.parent_id == span.context.span_id
for reference in follow_span.references:
assert reference.referenced_context is not None

tracer.reporter = mock.MagicMock()
span = tracer.start_span('test')
follow_span = tracer.start_span(references=follows_from(span.context))
span.finish()
follow_span.finish()
tracer.reporter.report_span.assert_called_once()
tracer.reporter.report_span.assert_called()
assert isinstance(follow_span.references, list)

tracer.reporter = mock.MagicMock()
span = tracer.start_span('test')
parent_span = tracer.start_span('test-parent')
child_span = tracer.start_span('test-child', child_of=parent_span,
references=follows_from(span.context))
span.finish()
parent_span.finish()
child_span.finish()
tracer.reporter.report_span.assert_called_once()
tracer.reporter.report_span.assert_called()
assert child_span.context.parent_id == parent_span.context.span_id
assert len(child_span.references) == 1
tracer.close()
Expand Down

0 comments on commit ec2ed1c

Please sign in to comment.