File tree Expand file tree Collapse file tree
python/packages/autogen-ext/tests/code_executors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,19 +334,12 @@ async def test_delete_tmp_files() -> None:
334334 pytest .skip ("Docker tests are disabled" )
335335
336336 with tempfile .TemporaryDirectory () as temp_dir :
337- # Test with delete_tmp_files=False (default)
338- async with DockerCommandLineCodeExecutor (work_dir = temp_dir ) as executor :
339- cancellation_token = CancellationToken ()
340- code_blocks = [CodeBlock (code = "print('test output')" , language = "python" )]
341- result = await executor .execute_code_blocks (code_blocks , cancellation_token )
342- assert result .exit_code == 0
343- assert result .code_file is not None
344- # Verify file exists after execution
345- assert Path (result .code_file ).exists ()
346-
347- # Test with delete_tmp_files=True
337+ # Test with delete_tmp_files=True using a single executor instance
338+ # to avoid the overhead of creating multiple Docker containers.
348339 async with DockerCommandLineCodeExecutor (work_dir = temp_dir , delete_tmp_files = True ) as executor :
349340 cancellation_token = CancellationToken ()
341+
342+ # Test single code block
350343 code_blocks = [CodeBlock (code = "print('test output')" , language = "python" )]
351344 result = await executor .execute_code_blocks (code_blocks , cancellation_token )
352345 assert result .exit_code == 0
You can’t perform that action at this time.
0 commit comments