@@ -1771,18 +1771,18 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
17711771 assert int (response .http_request .headers .get ("x-stainless-retry-count" )) == failures_before_success
17721772
17731773 def test_get_platform (self ) -> None :
1774- # Issue https://github.com/openai/openai-python/issues/1827 was caused
1775- # asyncify leaving threads unterminated when used with nest_asyncio.
1774+ # A previous implementation of asyncify could leave threads unterminated when
1775+ # used with nest_asyncio.
1776+ #
17761777 # Since nest_asyncio.apply() is global and cannot be un-applied, this
17771778 # test is run in a separate process to avoid affecting other tests.
1778- test_code = dedent ("""\
1779+ test_code = dedent ("""
17791780 import asyncio
17801781 import nest_asyncio
1781-
17821782 import threading
17831783
1784- from openai._base_client import get_platform
17851784 from openai._utils import asyncify
1785+ from openai._base_client import get_platform
17861786
17871787 async def test_main() -> None:
17881788 result = await asyncify(get_platform)()
@@ -1795,17 +1795,12 @@ async def test_main() -> None:
17951795 """ )
17961796 with subprocess .Popen (
17971797 [sys .executable , "-c" , test_code ],
1798- stdout = subprocess .PIPE ,
1799- stderr = subprocess .PIPE ,
18001798 text = True ,
18011799 ) as process :
18021800 try :
18031801 process .wait (2 )
18041802 if process .returncode :
1805- print (process .stdout )
1806- print (process .stderr )
18071803 raise AssertionError ("calling get_platform using asyncify resulted in a non-zero exit code" )
18081804 except subprocess .TimeoutExpired as e :
18091805 process .kill ()
18101806 raise AssertionError ("calling get_platform using asyncify resulted in a hung process" ) from e
1811-
0 commit comments