Basic fixtures
provide.testkit.threading.basic_fixtures
¶
Basic threading test fixtures.
Core fixtures for creating threads, thread pools, mocks, and thread-local storage.
Functions¶
mock_thread
¶
Create a mock thread for testing without actual threading.
Returns:
| Type | Description |
|---|---|
Mock
|
Mock thread object. |
Source code in provide/testkit/threading/basic_fixtures.py
test_thread
¶
test_thread() -> Callable[
[
Callable[..., Any],
tuple[Any, ...],
dict[str, Any] | None,
bool,
],
threading.Thread,
]
Create a test thread with automatic cleanup.
Returns:
| Type | Description |
|---|---|
Callable[[Callable[..., Any], tuple[Any, ...], dict[str, Any] | None, bool], Thread]
|
Function to create and manage test threads. |
Source code in provide/testkit/threading/basic_fixtures.py
thread_local_storage
¶
Create thread-local storage for testing.
Returns:
| Type | Description |
|---|---|
local
|
Thread-local storage object. |
thread_pool
¶
Create a thread pool executor for testing.
Returns:
| Type | Description |
|---|---|
ThreadPoolExecutor
|
ThreadPoolExecutor instance with automatic cleanup. |