def test_background_transaction_start_stop(tracked_request): BackgroundTransaction.start("Foo") BackgroundTransaction.stop() assert len(tracked_request.active_spans) == 0 assert len(tracked_request.complete_spans) == 1 assert tracked_request.complete_spans[0].operation == "Job/Foo"
def test_background_transaction_start_stop(): tr = TrackedRequest.instance() BackgroundTransaction.start("Foo") BackgroundTransaction.stop() span = tr.complete_spans[-1] assert span.operation == "Job/Foo"