File tree Expand file tree Collapse file tree 8 files changed +31
-19
lines changed Expand file tree Collapse file tree 8 files changed +31
-19
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ testpaths = ["tests"]
129129addopts = " --tb=short"
130130xfail_strict = true
131131asyncio_mode = " auto"
132+ asyncio_default_fixture_loop_scope = " session"
132133filterwarnings = [
133134 " error"
134135]
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class CreditsResource(SyncAPIResource):
2323 @cached_property
2424 def with_raw_response (self ) -> CreditsResourceWithRawResponse :
2525 """
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
2727 the raw response object instead of the parsed content.
2828
2929 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -63,7 +63,7 @@ class AsyncCreditsResource(AsyncAPIResource):
6363 @cached_property
6464 def with_raw_response (self ) -> AsyncCreditsResourceWithRawResponse :
6565 """
66- This property can be used as a prefix for any HTTP method call to return the
66+ This property can be used as a prefix for any HTTP method call to return
6767 the raw response object instead of the parsed content.
6868
6969 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class CameraMotionResource(SyncAPIResource):
2323 @cached_property
2424 def with_raw_response (self ) -> CameraMotionResourceWithRawResponse :
2525 """
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
2727 the raw response object instead of the parsed content.
2828
2929 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -63,7 +63,7 @@ class AsyncCameraMotionResource(AsyncAPIResource):
6363 @cached_property
6464 def with_raw_response (self ) -> AsyncCameraMotionResourceWithRawResponse :
6565 """
66- This property can be used as a prefix for any HTTP method call to return the
66+ This property can be used as a prefix for any HTTP method call to return
6767 the raw response object instead of the parsed content.
6868
6969 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def video(self) -> VideoResource:
6767 @cached_property
6868 def with_raw_response (self ) -> GenerationsResourceWithRawResponse :
6969 """
70- This property can be used as a prefix for any HTTP method call to return the
70+ This property can be used as a prefix for any HTTP method call to return
7171 the raw response object instead of the parsed content.
7272
7373 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -268,7 +268,7 @@ def video(self) -> AsyncVideoResource:
268268 @cached_property
269269 def with_raw_response (self ) -> AsyncGenerationsResourceWithRawResponse :
270270 """
271- This property can be used as a prefix for any HTTP method call to return the
271+ This property can be used as a prefix for any HTTP method call to return
272272 the raw response object instead of the parsed content.
273273
274274 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class ImageResource(SyncAPIResource):
3131 @cached_property
3232 def with_raw_response (self ) -> ImageResourceWithRawResponse :
3333 """
34- This property can be used as a prefix for any HTTP method call to return the
34+ This property can be used as a prefix for any HTTP method call to return
3535 the raw response object instead of the parsed content.
3636
3737 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -115,7 +115,7 @@ class AsyncImageResource(AsyncAPIResource):
115115 @cached_property
116116 def with_raw_response (self ) -> AsyncImageResourceWithRawResponse :
117117 """
118- This property can be used as a prefix for any HTTP method call to return the
118+ This property can be used as a prefix for any HTTP method call to return
119119 the raw response object instead of the parsed content.
120120
121121 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class VideoResource(SyncAPIResource):
3030 @cached_property
3131 def with_raw_response (self ) -> VideoResourceWithRawResponse :
3232 """
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
3434 the raw response object instead of the parsed content.
3535
3636 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -110,7 +110,7 @@ class AsyncVideoResource(AsyncAPIResource):
110110 @cached_property
111111 def with_raw_response (self ) -> AsyncVideoResourceWithRawResponse :
112112 """
113- This property can be used as a prefix for any HTTP method call to return the
113+ This property can be used as a prefix for any HTTP method call to return
114114 the raw response object instead of the parsed content.
115115
116116 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class PingResource(SyncAPIResource):
2323 @cached_property
2424 def with_raw_response (self ) -> PingResourceWithRawResponse :
2525 """
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
2727 the raw response object instead of the parsed content.
2828
2929 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -63,7 +63,7 @@ class AsyncPingResource(AsyncAPIResource):
6363 @cached_property
6464 def with_raw_response (self ) -> AsyncPingResourceWithRawResponse :
6565 """
66- This property can be used as a prefix for any HTTP method call to return the
66+ This property can be used as a prefix for any HTTP method call to return
6767 the raw response object instead of the parsed content.
6868
6969 For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
Original file line number Diff line number Diff line change 66import os
77import sys
88import json
9+ import time
910import asyncio
1011import inspect
1112import subprocess
@@ -1660,10 +1661,20 @@ async def test_main() -> None:
16601661 [sys .executable , "-c" , test_code ],
16611662 text = True ,
16621663 ) as process :
1663- try :
1664- process .wait (2 )
1665- if process .returncode :
1666- raise AssertionError ("calling get_platform using asyncify resulted in a non-zero exit code" )
1667- except subprocess .TimeoutExpired as e :
1668- process .kill ()
1669- raise AssertionError ("calling get_platform using asyncify resulted in a hung process" ) from e
1664+ timeout = 10 # seconds
1665+
1666+ start_time = time .monotonic ()
1667+ while True :
1668+ return_code = process .poll ()
1669+ if return_code is not None :
1670+ if return_code != 0 :
1671+ raise AssertionError ("calling get_platform using asyncify resulted in a non-zero exit code" )
1672+
1673+ # success
1674+ break
1675+
1676+ if time .monotonic () - start_time > timeout :
1677+ process .kill ()
1678+ raise AssertionError ("calling get_platform using asyncify resulted in a hung process" )
1679+
1680+ time .sleep (0.1 )
You can’t perform that action at this time.
0 commit comments