Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ testpaths = ["tests"]
addopts = "--tb=short"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"error"
]
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ContextsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> ContextsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -153,7 +153,7 @@ class AsyncContextsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncContextsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ExtensionsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> ExtensionsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -159,7 +159,7 @@ class AsyncExtensionsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncExtensionsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ProjectsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> ProjectsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -131,7 +131,7 @@ class AsyncProjectsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/sessions/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DownloadsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> DownloadsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -81,7 +81,7 @@ class AsyncDownloadsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/sessions/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LogsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> LogsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -77,7 +77,7 @@ class AsyncLogsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncLogsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/sessions/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RecordingResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> RecordingResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -77,7 +77,7 @@ class AsyncRecordingResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncRecordingResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def uploads(self) -> UploadsResource:
@cached_property
def with_raw_response(self) -> SessionsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -347,7 +347,7 @@ def uploads(self) -> AsyncUploadsResource:
@cached_property
def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
4 changes: 2 additions & 2 deletions src/browserbase/resources/sessions/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UploadsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> UploadsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down Expand Up @@ -95,7 +95,7 @@ class AsyncUploadsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncUploadsResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Expand Down
25 changes: 18 additions & 7 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import sys
import json
import time
import asyncio
import inspect
import subprocess
Expand Down Expand Up @@ -1639,10 +1640,20 @@ async def test_main() -> None:
[sys.executable, "-c", test_code],
text=True,
) as process:
try:
process.wait(2)
if process.returncode:
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
except subprocess.TimeoutExpired as e:
process.kill()
raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e
timeout = 10 # seconds

start_time = time.monotonic()
while True:
return_code = process.poll()
if return_code is not None:
if return_code != 0:
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")

# success
break

if time.monotonic() - start_time > timeout:
process.kill()
raise AssertionError("calling get_platform using asyncify resulted in a hung process")

time.sleep(0.1)