hbutils.testing.capture
Utilities for capturing program exit behavior and output streams in tests.
This module provides a convenient namespace that re-exports capture utilities
implemented in the hbutils.testing.capture.exit and
hbutils.testing.capture.output submodules. These tools are typically
used in unit tests to intercept system exits or capture stdout/stderr streams
without affecting the surrounding test environment.
The module exposes the public APIs from its submodules, including:
hbutils.testing.capture.exit- Utilities for capturing and testing system exit behavior.hbutils.testing.capture.output- Utilities for capturing stdout/stderr output streams.
Example:
>>> from hbutils.testing.capture import capture_exit, capture_output
>>> # Use capture_exit in a test to intercept sys.exit()
>>> # Use capture_output in a test to capture printed output
Note
The exact functions and classes provided by this module depend on the public API of the re-exported submodules.