Coverage for tests / unit / utils / async_tool_executor / test_shutdown.py: 100%
13 statements
« prev ^ index » next coverage.py v7.13.0, created at 2026-04-03 18:53 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2026-04-03 18:53 +0000
1"""Tests for shutdown functionality."""
3from __future__ import annotations
5from assertpy import assert_that
7from lintro.utils.async_tool_executor import AsyncToolExecutor
10def test_shutdown_closes_thread_pool() -> None:
11 """Test that shutdown properly closes the thread pool."""
12 exec_instance = AsyncToolExecutor(max_workers=2)
14 assert_that(exec_instance._executor).is_not_none()
16 exec_instance.shutdown()
18 assert_that(exec_instance._executor).is_none()
21def test_shutdown_can_be_called_multiple_times() -> None:
22 """Test that shutdown is idempotent."""
23 exec_instance = AsyncToolExecutor(max_workers=2)
25 exec_instance.shutdown()
26 exec_instance.shutdown() # Should not raise
28 assert_that(exec_instance._executor).is_none()