Skip to content

Commit 5780c15

Browse files
committed
Fix imports
1 parent cd14bbd commit 5780c15

File tree

5 files changed

+30
-25
lines changed

5 files changed

+30
-25
lines changed

tests/parametric/test_otel_logs.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import pytest
21
import base64
2+
from collections.abc import Generator
3+
from urllib.parse import urlparse
4+
5+
import pytest
36

47
from utils import scenarios, features, logger, irrelevant, context
5-
from utils.parametric._library_client import LogLevel
6-
from utils.docker_fixtures.spec.trace import find_only_span
7-
from urllib.parse import urlparse
8+
from utils.docker_fixtures.parametric import LogLevel
89
from utils.docker_fixtures import TestAgentAPI
10+
from utils.docker_fixtures.spec.trace import find_only_span
11+
912
from .conftest import APMLibrary
10-
from collections.abc import Generator
1113

1214

1315
def find_log_record(log_payloads: list[dict], logger_name: str, log_message: str) -> dict | None:

tests/parametric/test_otel_span_methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
import pytest
44

5-
from utils.parametric._library_client import Link
65
from opentelemetry.trace import StatusCode
76
from opentelemetry.trace import SpanKind
7+
from utils.docker_fixtures.parametric import Link
88
from utils.docker_fixtures.spec.trace import find_span
99
from utils.docker_fixtures.spec.trace import find_trace
1010
from utils.docker_fixtures.spec.trace import retrieve_span_events
1111
from utils.docker_fixtures.spec.trace import retrieve_span_links
1212
from utils.docker_fixtures.spec.trace import find_first_span_in_trace_payload
13-
from utils import bug, features, missing_feature, irrelevant, context, scenarios
1413
from utils.docker_fixtures import TestAgentAPI
14+
from utils import bug, features, missing_feature, irrelevant, context, scenarios
1515
from .conftest import APMLibrary
1616

1717
# this global mark applies to all tests in this file.

tests/parametric/test_parametric_endpoints.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
import pytest
1010
import time
1111

12+
from opentelemetry.trace import SpanKind
13+
from opentelemetry.trace import StatusCode
14+
15+
from utils import irrelevant, bug, incomplete_test_app, scenarios, features, context
1216
from utils.docker_fixtures.spec.trace import find_trace
1317
from utils.docker_fixtures.spec.trace import find_span
1418
from utils.docker_fixtures.spec.trace import find_span_in_traces
1519
from utils.docker_fixtures.spec.trace import retrieve_span_links
1620
from utils.docker_fixtures.spec.trace import retrieve_span_events
1721
from utils.docker_fixtures.spec.trace import find_only_span
18-
from utils import irrelevant, bug, incomplete_test_app, scenarios, features, context
19-
from opentelemetry.trace import SpanKind
20-
from opentelemetry.trace import StatusCode
21-
from utils.parametric._library_client import Link, LogLevel
22+
from utils.docker_fixtures.parametric import Link, LogLevel
2223
from utils.docker_fixtures import TestAgentAPI, ParametricTestClientApi as APMLibrary
2324

2425
# this global mark applies to all tests in this file.

utils/docker_fixtures/_test_clients/_test_client_parametric.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from collections.abc import Generator, Iterable
22
import contextlib
3-
from enum import Enum
43
from http import HTTPStatus
54
import time
65
from types import TracebackType
7-
from typing import TextIO, TypedDict, NotRequired
6+
from typing import TextIO, TypedDict
87
import urllib.parse
98

109
from _pytest.outcomes import Failed
@@ -16,6 +15,7 @@
1615
from utils.docker_fixtures._core import get_host_port, docker_run
1716
from utils.docker_fixtures._test_agent import TestAgentAPI
1817
from utils.docker_fixtures.spec.otel_trace import OtelSpanContext
18+
from utils.docker_fixtures.parametric import LogLevel, Link
1919
from utils._logger import logger
2020

2121
from ._core import TestClientFactory
@@ -89,13 +89,6 @@ def get_apm_library(
8989
yield client
9090

9191

92-
class LogLevel(Enum):
93-
DEBUG = "DEBUG"
94-
INFO = "INFO"
95-
WARNING = "WARNING"
96-
ERROR = "ERROR"
97-
98-
9992
def _fail(message: str):
10093
"""Used to mak a test as failed"""
10194
logger.error(message)
@@ -112,11 +105,6 @@ class SpanResponse(TypedDict):
112105
trace_id: int
113106

114107

115-
class Link(TypedDict):
116-
parent_id: int
117-
attributes: NotRequired[dict]
118-
119-
120108
class Event(TypedDict):
121109
time_unix_nano: int
122110
name: str
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from enum import Enum
2+
from typing import TypedDict, NotRequired
3+
4+
5+
class LogLevel(Enum):
6+
DEBUG = "DEBUG"
7+
INFO = "INFO"
8+
WARNING = "WARNING"
9+
ERROR = "ERROR"
10+
11+
12+
class Link(TypedDict):
13+
parent_id: int
14+
attributes: NotRequired[dict]

0 commit comments

Comments
 (0)