File tree 10 files changed +35
-23
lines changed
src/browserbase/resources
10 files changed +35
-23
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ testpaths = ["tests"]
129
129
addopts = " --tb=short"
130
130
xfail_strict = true
131
131
asyncio_mode = " auto"
132
+ asyncio_default_fixture_loop_scope = " session"
132
133
filterwarnings = [
133
134
" error"
134
135
]
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class ContextsResource(SyncAPIResource):
30
30
@cached_property
31
31
def with_raw_response (self ) -> ContextsResourceWithRawResponse :
32
32
"""
33
- This property can be used as a prefix for any HTTP method call to return the
33
+ This property can be used as a prefix for any HTTP method call to return
34
34
the raw response object instead of the parsed content.
35
35
36
36
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -153,7 +153,7 @@ class AsyncContextsResource(AsyncAPIResource):
153
153
@cached_property
154
154
def with_raw_response (self ) -> AsyncContextsResourceWithRawResponse :
155
155
"""
156
- This property can be used as a prefix for any HTTP method call to return the
156
+ This property can be used as a prefix for any HTTP method call to return
157
157
the raw response object instead of the parsed content.
158
158
159
159
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class ExtensionsResource(SyncAPIResource):
32
32
@cached_property
33
33
def with_raw_response (self ) -> ExtensionsResourceWithRawResponse :
34
34
"""
35
- This property can be used as a prefix for any HTTP method call to return the
35
+ This property can be used as a prefix for any HTTP method call to return
36
36
the raw response object instead of the parsed content.
37
37
38
38
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -159,7 +159,7 @@ class AsyncExtensionsResource(AsyncAPIResource):
159
159
@cached_property
160
160
def with_raw_response (self ) -> AsyncExtensionsResourceWithRawResponse :
161
161
"""
162
- This property can be used as a prefix for any HTTP method call to return the
162
+ This property can be used as a prefix for any HTTP method call to return
163
163
the raw response object instead of the parsed content.
164
164
165
165
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class ProjectsResource(SyncAPIResource):
25
25
@cached_property
26
26
def with_raw_response (self ) -> ProjectsResourceWithRawResponse :
27
27
"""
28
- This property can be used as a prefix for any HTTP method call to return the
28
+ This property can be used as a prefix for any HTTP method call to return
29
29
the raw response object instead of the parsed content.
30
30
31
31
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -131,7 +131,7 @@ class AsyncProjectsResource(AsyncAPIResource):
131
131
@cached_property
132
132
def with_raw_response (self ) -> AsyncProjectsResourceWithRawResponse :
133
133
"""
134
- This property can be used as a prefix for any HTTP method call to return the
134
+ This property can be used as a prefix for any HTTP method call to return
135
135
the raw response object instead of the parsed content.
136
136
137
137
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class DownloadsResource(SyncAPIResource):
26
26
@cached_property
27
27
def with_raw_response (self ) -> DownloadsResourceWithRawResponse :
28
28
"""
29
- This property can be used as a prefix for any HTTP method call to return the
29
+ This property can be used as a prefix for any HTTP method call to return
30
30
the raw response object instead of the parsed content.
31
31
32
32
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -81,7 +81,7 @@ class AsyncDownloadsResource(AsyncAPIResource):
81
81
@cached_property
82
82
def with_raw_response (self ) -> AsyncDownloadsResourceWithRawResponse :
83
83
"""
84
- This property can be used as a prefix for any HTTP method call to return the
84
+ This property can be used as a prefix for any HTTP method call to return
85
85
the raw response object instead of the parsed content.
86
86
87
87
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class LogsResource(SyncAPIResource):
23
23
@cached_property
24
24
def with_raw_response (self ) -> LogsResourceWithRawResponse :
25
25
"""
26
- This property can be used as a prefix for any HTTP method call to return the
26
+ This property can be used as a prefix for any HTTP method call to return
27
27
the raw response object instead of the parsed content.
28
28
29
29
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -77,7 +77,7 @@ class AsyncLogsResource(AsyncAPIResource):
77
77
@cached_property
78
78
def with_raw_response (self ) -> AsyncLogsResourceWithRawResponse :
79
79
"""
80
- This property can be used as a prefix for any HTTP method call to return the
80
+ This property can be used as a prefix for any HTTP method call to return
81
81
the raw response object instead of the parsed content.
82
82
83
83
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class RecordingResource(SyncAPIResource):
23
23
@cached_property
24
24
def with_raw_response (self ) -> RecordingResourceWithRawResponse :
25
25
"""
26
- This property can be used as a prefix for any HTTP method call to return the
26
+ This property can be used as a prefix for any HTTP method call to return
27
27
the raw response object instead of the parsed content.
28
28
29
29
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -77,7 +77,7 @@ class AsyncRecordingResource(AsyncAPIResource):
77
77
@cached_property
78
78
def with_raw_response (self ) -> AsyncRecordingResourceWithRawResponse :
79
79
"""
80
- This property can be used as a prefix for any HTTP method call to return the
80
+ This property can be used as a prefix for any HTTP method call to return
81
81
the raw response object instead of the parsed content.
82
82
83
83
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def uploads(self) -> UploadsResource:
82
82
@cached_property
83
83
def with_raw_response (self ) -> SessionsResourceWithRawResponse :
84
84
"""
85
- This property can be used as a prefix for any HTTP method call to return the
85
+ This property can be used as a prefix for any HTTP method call to return
86
86
the raw response object instead of the parsed content.
87
87
88
88
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -347,7 +347,7 @@ def uploads(self) -> AsyncUploadsResource:
347
347
@cached_property
348
348
def with_raw_response (self ) -> AsyncSessionsResourceWithRawResponse :
349
349
"""
350
- This property can be used as a prefix for any HTTP method call to return the
350
+ This property can be used as a prefix for any HTTP method call to return
351
351
the raw response object instead of the parsed content.
352
352
353
353
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class UploadsResource(SyncAPIResource):
32
32
@cached_property
33
33
def with_raw_response (self ) -> UploadsResourceWithRawResponse :
34
34
"""
35
- This property can be used as a prefix for any HTTP method call to return the
35
+ This property can be used as a prefix for any HTTP method call to return
36
36
the raw response object instead of the parsed content.
37
37
38
38
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -95,7 +95,7 @@ class AsyncUploadsResource(AsyncAPIResource):
95
95
@cached_property
96
96
def with_raw_response (self ) -> AsyncUploadsResourceWithRawResponse :
97
97
"""
98
- This property can be used as a prefix for any HTTP method call to return the
98
+ This property can be used as a prefix for any HTTP method call to return
99
99
the raw response object instead of the parsed content.
100
100
101
101
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change 6
6
import os
7
7
import sys
8
8
import json
9
+ import time
9
10
import asyncio
10
11
import inspect
11
12
import subprocess
@@ -1639,10 +1640,20 @@ async def test_main() -> None:
1639
1640
[sys .executable , "-c" , test_code ],
1640
1641
text = True ,
1641
1642
) as process :
1642
- try :
1643
- process .wait (2 )
1644
- if process .returncode :
1645
- raise AssertionError ("calling get_platform using asyncify resulted in a non-zero exit code" )
1646
- except subprocess .TimeoutExpired as e :
1647
- process .kill ()
1648
- raise AssertionError ("calling get_platform using asyncify resulted in a hung process" ) from e
1643
+ timeout = 10 # seconds
1644
+
1645
+ start_time = time .monotonic ()
1646
+ while True :
1647
+ return_code = process .poll ()
1648
+ if return_code is not None :
1649
+ if return_code != 0 :
1650
+ raise AssertionError ("calling get_platform using asyncify resulted in a non-zero exit code" )
1651
+
1652
+ # success
1653
+ break
1654
+
1655
+ if time .monotonic () - start_time > timeout :
1656
+ process .kill ()
1657
+ raise AssertionError ("calling get_platform using asyncify resulted in a hung process" )
1658
+
1659
+ time .sleep (0.1 )
You can’t perform that action at this time.
0 commit comments