Skip to content

Commit 026c712

Browse files
committed
Fix tests
1 parent 758d47b commit 026c712

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

src/runloop_api_client/sdk/async_devbox.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import asyncio
66
import logging
7+
import warnings
78
from typing import TYPE_CHECKING, Any, Callable, Optional, Sequence, Awaitable, cast
89
from typing_extensions import Unpack, override
910

@@ -740,10 +741,12 @@ async def create_tunnel(
740741
>>> tunnel = await devbox.net.create_tunnel(port=8080)
741742
>>> print(f"Public URL: {tunnel.url}")
742743
"""
743-
return await self._devbox._client.devboxes.create_tunnel( # type: ignore[deprecated]
744-
self._devbox.id,
745-
**params,
746-
)
744+
with warnings.catch_warnings():
745+
warnings.simplefilter("ignore", DeprecationWarning)
746+
return await self._devbox._client.devboxes.create_tunnel( # type: ignore[deprecated]
747+
self._devbox.id,
748+
**params,
749+
)
747750

748751
async def remove_tunnel(
749752
self,

src/runloop_api_client/sdk/devbox.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import logging
6+
import warnings
67
import threading
78
from typing import TYPE_CHECKING, Any, Callable, Optional, Sequence
89
from typing_extensions import Unpack, override
@@ -743,10 +744,12 @@ def create_tunnel(
743744
>>> tunnel = devbox.net.create_tunnel(port=8080)
744745
>>> print(f"Public URL: {tunnel.url}")
745746
"""
746-
return self._devbox._client.devboxes.create_tunnel( # type: ignore[deprecated]
747-
self._devbox.id,
748-
**params,
749-
)
747+
with warnings.catch_warnings():
748+
warnings.simplefilter("ignore", DeprecationWarning)
749+
return self._devbox._client.devboxes.create_tunnel( # type: ignore[deprecated]
750+
self._devbox.id,
751+
**params,
752+
)
750753

751754
def remove_tunnel(
752755
self,

0 commit comments

Comments
 (0)