def prepare_stderr(): CALLBACK_REGISTRY.clear() STEP_REGISTRY.clear() if isinstance(sys.stderr, StringIO): del sys.stderr std = StringIO() sys.stderr = std
def prepare_stdout(): CALLBACK_REGISTRY.clear() if isinstance(sys.stdout, StringIO): del sys.stdout std = StringIO() sys.stdout = std