From bd6a02546b98fb79115b0997f5a5c9f54e0d9740 Mon Sep 17 00:00:00 2001 From: Dmitry Prokopchenkov Date: Mon, 24 Jul 2017 16:41:10 +0300 Subject: [PATCH] minor changes --- tests/logging_helper_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/logging_helper_test.py b/tests/logging_helper_test.py index ef87c79..343342d 100644 --- a/tests/logging_helper_test.py +++ b/tests/logging_helper_test.py @@ -333,6 +333,13 @@ def test_batch_sender_add_span(thrift_objs): assert thrift_objs.call_count == 1 +def test_batch_sender_with_error_on_exit(): + sender = logging_helper.ZipkinBatchSender(mock_transport_handler) + with pytest.raises(ZipkinError): + with sender: + raise Exception('Error!') + + @mock.patch('py_zipkin.logging_helper.thrift_objs_in_bytes', autospec=True) def test_batch_sender_add_span_many_times(thrift_obj): sender = logging_helper.ZipkinBatchSender(mock_transport_handler)