Skip to content

Commit 671a94f

Browse files
committed
remove unused vars
1 parent 664cfa6 commit 671a94f

File tree

9 files changed

+12
-50
lines changed

9 files changed

+12
-50
lines changed

tests/unit/client/api/versions/test_v4.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import pytest
2-
from unittest.mock import Mock, patch, MagicMock
2+
from unittest.mock import Mock, patch
33
from requests.models import Response
44

55
from agentops.client.api.versions.v4 import V4Client
66
from agentops.exceptions import ApiServerException
7-
from agentops.client.api.types import UploadedObjectResponse
87

98

109
class TestV4Client:

tests/unit/helpers/test_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import pytest
2-
from unittest.mock import Mock, patch, MagicMock
1+
from unittest.mock import Mock, patch
32
from importlib.metadata import PackageNotFoundError
43

54
from agentops.helpers.version import get_agentops_version, check_agentops_update

tests/unit/instrumentation/common/test_streaming.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import pytest
2-
from unittest.mock import Mock, patch, MagicMock
3-
import time
4-
import asyncio
5-
from typing import AsyncGenerator
2+
from unittest.mock import Mock, patch
63
from types import SimpleNamespace
74

85
from agentops.instrumentation.common.streaming import (

tests/unit/instrumentation/openai_core/test_instrumentor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def test_instrument_method_wraps_response_api(self, instrumentor):
107107
instrumentor_obj._custom_wrap()
108108

109109
# Verify wrap_function_wrapper was called for Response API methods
110-
assert mock_wfw.call_count >= 2, (
111-
f"Expected at least 2 calls to wrap_function_wrapper, got {mock_wfw.call_count}"
112-
)
110+
assert (
111+
mock_wfw.call_count >= 2
112+
), f"Expected at least 2 calls to wrap_function_wrapper, got {mock_wfw.call_count}"
113113

114114
# Find Response API calls
115115
response_api_calls = []

tests/unit/sdk/instrumentation_tester.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def reset_trace_globals():
4545

4646
class HasAttributesViaProperty(Protocol):
4747
@property
48-
def attributes(self) -> Attributes: ...
48+
def attributes(self) -> Attributes:
49+
...
4950

5051

5152
class HasAttributesViaAttr(Protocol):

tests/unit/sdk/test_attributes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
This module tests all attribute management functions for telemetry contexts.
55
"""
66

7-
import os
87
import platform
9-
from unittest.mock import Mock, patch, MagicMock
10-
from typing import Any
8+
from unittest.mock import Mock, patch
119

1210
import pytest
13-
import psutil
1411

1512
from agentops.sdk.attributes import (
1613
get_system_resource_attributes,

tests/unit/sdk/test_exporters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"""
44

55
import unittest
6-
from unittest.mock import Mock, patch, MagicMock
7-
from typing import List
6+
from unittest.mock import Mock, patch
87

98
import requests
109
from opentelemetry.sdk.trace import ReadableSpan

tests/unit/sdk/test_factory.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import AsyncGenerator
21
import asyncio
32
import inspect
43
import pytest
@@ -642,7 +641,7 @@ def test_decorator_with_builtin_function(self, instrumentation: InstrumentationT
642641
assert result == 5
643642

644643
# Built-in functions may not be instrumented the same way
645-
spans = instrumentation.get_finished_spans()
644+
_ = instrumentation.get_finished_spans()
646645
# The behavior may vary depending on the implementation
647646

648647
def test_decorator_with_coroutine_function(self, instrumentation: InstrumentationTester):

tests/unit/test_init_py.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def test_start_trace_auto_init_failure():
344344
def test_start_trace_auto_init_still_not_initialized():
345345
with (
346346
patch("agentops.tracer") as mock_tracer,
347-
patch("agentops.init") as mock_init,
347+
patch("agentops.init") as _,
348348
patch("agentops.logger") as mock_logger,
349349
):
350350
mock_tracer.initialized = False
@@ -372,35 +372,6 @@ def test_all_exports_importable():
372372
from agentops import (
373373
init,
374374
configure,
375-
get_client,
376-
record,
377-
start_trace,
378-
end_trace,
379-
update_trace_metadata,
380-
start_session,
381-
end_session,
382-
track_agent,
383-
track_tool,
384-
end_all_sessions,
385-
ToolEvent,
386-
ErrorEvent,
387-
ActionEvent,
388-
LLMEvent,
389-
Session,
390-
trace,
391-
session,
392-
agent,
393-
task,
394-
workflow,
395-
operation,
396-
guardrail,
397-
tracer,
398-
tool,
399-
TraceState,
400-
SUCCESS,
401-
ERROR,
402-
UNSET,
403-
StatusCode,
404375
)
405376

406377
assert callable(init)

0 commit comments

Comments
 (0)