Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 37009a9

Browse files
authored
Merge pull request #1 from UiPath/fix/lint_tests
fix: check static types in tests
2 parents c6dac76 + 366b0c6 commit 37009a9

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
from opentelemetry.sdk.trace import TracerProvider
66
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
77
from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
8-
from opentelemetry.sdk.trace.sampling import ALWAYS_ON, ParentBased
98

109

1110
class SpanCapture:
1211
"""Helper to capture and analyze spans."""
1312

1413
def __init__(self):
1514
self.exporter = InMemorySpanExporter()
16-
self.provider = TracerProvider(sampler=ParentBased(root=ALWAYS_ON))
15+
self.provider = TracerProvider()
1716
self.provider.add_span_processor(SimpleSpanProcessor(self.exporter))
1817
trace.set_tracer_provider(self.provider)
1918

tests/tracing/test_serialization.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ def process_timestamp(timestamp: datetime):
118118

119119
def test_traced_with_complex_return_value(span_capture: SpanCapture):
120120
"""Test tracing with complex return value."""
121+
from typing import Any, Dict
122+
121123
from pydantic import BaseModel
122124

123125
from uipath.core.tracing.decorators import traced
124126

125127
class Result(BaseModel):
126128
success: bool
127-
data: dict
129+
data: Dict[str, Any]
128130

129131
@traced(name="get_result")
130132
def get_result():
@@ -145,10 +147,12 @@ def get_result():
145147

146148
def test_traced_with_set_and_tuple(span_capture: SpanCapture):
147149
"""Test tracing with set and tuple inputs."""
150+
from typing import Set, Tuple
151+
148152
from uipath.core.tracing.decorators import traced
149153

150154
@traced(name="process_collections")
151-
def process_collections(items: set, pair: tuple):
155+
def process_collections(items: Set[int], pair: Tuple[int, ...]) -> int:
152156
return len(items) + len(pair)
153157

154158
result = process_collections({1, 2, 3}, (4, 5))

tests/tracing/test_span_nesting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Test span nesting behavior for traced decorators."""
22

33
import pytest
4-
from opentelemetry import trace
54

65
from tests.conftest import SpanCapture
76

0 commit comments

Comments
 (0)