Skip to content

Commit dc6b5e1

Browse files
committed
Fix some warnings and deprecations
1 parent 5231399 commit dc6b5e1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/common/telemetry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import asyncio
21
from functools import wraps
2+
from inspect import iscoroutinefunction
33

44
from opentelemetry import metrics, trace
55
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import OTLPLogExporter
@@ -72,7 +72,7 @@ def sync_wrapper(*args, **kwargs):
7272
span.set_status(trace.status.Status(trace.status.StatusCode.ERROR))
7373
raise
7474

75-
return async_wrapper if asyncio.iscoroutinefunction(func) else sync_wrapper
75+
return async_wrapper if iscoroutinefunction(func) else sync_wrapper
7676

7777
return decorator
7878

tests/common/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
from inspect import iscoroutinefunction
23

34
import pytest
45

@@ -32,7 +33,7 @@ async def async_wrapper(*args, **kwargs):
3233
result = await func(*args, **kwargs)
3334
return result + 10
3435

35-
return wrapper if not asyncio.iscoroutinefunction(func) else async_wrapper
36+
return wrapper if not iscoroutinefunction(func) else async_wrapper
3637

3738
@apply_decorator_to_methods(
3839
decorator=add_ten_decorator,

tests/socketio_app/web_routes/test_docs.py

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

1616

1717
# Test model
18-
class TestModel(BaseModel):
18+
class SomeModel(BaseModel):
1919
name: str
2020
value: int
2121

2222

2323
# Fixtures
2424
@pytest.fixture
2525
def test_model():
26-
return TestModel(name="test", value=42)
26+
return SomeModel(name="test", value=42)
2727

2828

2929
@pytest.fixture

0 commit comments

Comments
 (0)