forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
40 lines (29 loc) · 1.08 KB
/
conftest.py
File metadata and controls
40 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
import pytest
span_exporter = InMemorySpanExporter()
@pytest.fixture(scope="session")
def tracer():
processor = SimpleSpanProcessor(span_exporter)
provider = TracerProvider()
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
return provider.get_tracer(__name__)
@pytest.fixture(scope="function")
def exporter():
span_exporter.clear()
return span_exporter
@pytest.fixture(scope="session")
def config():
return {
"storage_account_name": os.environ["AZURE_STORAGE_ACCOUNT_NAME"],
"storage_account_key": os.environ["AZURE_STORAGE_ACCOUNT_KEY"],
"storage_connection_string": os.environ["AZURE_STORAGE_CONNECTION_STRING"],
}