@@ -105,9 +105,11 @@ def fake_import(name, globals=None, locals=None, fromlist=(), level=0):
105105@patch ("builtins.__import__" , side_effect = fake_import )
106106@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
107107 return_value = "mocked_streaming_response" )
108+ @patch ("proxy_worker.dispatcher.check_python_eol" )
108109@pytest .mark .asyncio
109110async def test_worker_init_v2_import (
110- mock_streaming , mock_import , mock_exists , mock_logger , mock_prioritize ,
111+ mock_eol , mock_streaming , mock_import , mock_exists ,
112+ mock_logger , mock_prioritize ,
111113 mock_should_load
112114):
113115 dispatcher = Dispatcher (asyncio .get_event_loop (), "localhost" , 7071 , "worker123" ,
@@ -130,9 +132,11 @@ async def test_worker_init_v2_import(
130132@patch ("builtins.__import__" , side_effect = fake_import )
131133@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
132134 return_value = "mocked_streaming_response" )
135+ @patch ("proxy_worker.dispatcher.check_python_eol" )
133136@pytest .mark .asyncio
134137async def test_worker_init_fallback_to_v1 (
135- mock_streaming , mock_import , mock_exists , mock_logger , mock_prioritize ,
138+ mock_eol , mock_streaming , mock_import , mock_exists ,
139+ mock_logger , mock_prioritize ,
136140 mock_should_load
137141):
138142 dispatcher = Dispatcher (asyncio .get_event_loop (), "localhost" , 7071 , "worker123" ,
@@ -154,9 +158,10 @@ async def test_worker_init_fallback_to_v1(
154158@patch ("builtins.__import__" , side_effect = fake_import )
155159@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
156160 return_value = "mocked_reload_response" )
161+ @patch ("proxy_worker.dispatcher.check_python_eol" )
157162@pytest .mark .asyncio
158163async def test_function_environment_reload_v2_import (
159- mock_streaming , mock_import , mock_exists , mock_logger , mock_prioritize
164+ mock_eol , mock_streaming , mock_import , mock_exists , mock_logger , mock_prioritize
160165):
161166 dispatcher = Dispatcher (asyncio .get_event_loop (), "localhost" , 7071 ,
162167 "worker123" , "req789" , 5.0 )
@@ -177,9 +182,10 @@ async def test_function_environment_reload_v2_import(
177182@patch ("builtins.__import__" , side_effect = fake_import )
178183@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
179184 return_value = "mocked_reload_response" )
185+ @patch ("proxy_worker.dispatcher.check_python_eol" )
180186@pytest .mark .asyncio
181187async def test_function_environment_reload_fallback_to_v1 (
182- mock_streaming , mock_import , mock_exists , mock_logger , mock_prioritize
188+ mock_eol , mock_streaming , mock_import , mock_exists , mock_logger , mock_prioritize
183189):
184190 dispatcher = Dispatcher (asyncio .get_event_loop (), "localhost" , 7071 , "worker123" ,
185191 "req789" , 5.0 )
@@ -301,8 +307,10 @@ def get_threadpool_executor():
301307@patch ("builtins.__import__" )
302308@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
303309 return_value = "mocked_init_response" )
310+ @patch ("proxy_worker.dispatcher.check_python_eol" )
304311@pytest .mark .asyncio
305- async def test_worker_init_starts_threadpool (mock_streaming , mock_import , * _mocks ):
312+ async def test_worker_init_starts_threadpool (mock_eol , mock_streaming ,
313+ mock_import , * _mocks ):
306314 runtime_module = _make_runtime_module (with_threadpool = True )
307315
308316 def fake_import (name , * a , ** k ):
@@ -327,8 +335,10 @@ def fake_import(name, *a, **k):
327335@patch ("builtins.__import__" )
328336@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
329337 return_value = "mocked_reload_response" )
338+ @patch ("proxy_worker.dispatcher.check_python_eol" )
330339@pytest .mark .asyncio
331- async def test_env_reload_starts_threadpool (mock_streaming , mock_import , * _mocks ):
340+ async def test_env_reload_starts_threadpool (mock_eol , mock_streaming ,
341+ mock_import , * _mocks ):
332342 runtime_module = _make_runtime_module (with_threadpool = True )
333343
334344 def fake_import (name , * a , ** k ):
@@ -359,8 +369,10 @@ def fake_import(name, *a, **k):
359369@patch ("builtins.__import__" )
360370@patch ("proxy_worker.dispatcher.protos.StreamingMessage" ,
361371 return_value = "mocked_init_response" )
372+ @patch ("proxy_worker.dispatcher.check_python_eol" )
362373@pytest .mark .asyncio
363- async def test_worker_init_missing_threadpool_apis (mock_streaming , mock_import ,
374+ async def test_worker_init_missing_threadpool_apis (mock_eol ,
375+ mock_streaming , mock_import ,
364376 mock_exists , mock_logger , * _ ):
365377 runtime_module = _make_runtime_module (with_threadpool = False )
366378
0 commit comments