botorch.test_utils
Mock
Utilities for speeding up optimization in tests.
- botorch.test_utils.mock.mock_optimize_context_manager(force=False)[source]
A context manager that uses mocks to speed up optimization for testing. Currently, the primary tactic is to force the underlying scipy methods to stop after just one iteration.
- force: If True will not raise an AssertionError if no mocks are called.
USE RESPONSIBLY.
- Parameters:
force (bool)
- Return type:
Generator[None, None, None]