116
116
def test_suite():
118
118
return tests.test_suite()
123
stdin=None, stdout=None, stderr=None):
124
"""Set up everything needed for normal use of bzrlib.
126
Most applications that embed bzrlib, including bzr itself, should call
127
this function to initialize various subsystems.
129
More options may be added in future so callers should use named arguments.
131
:param setup_ui: If true (default) use a terminal UI; otherwise
132
something else must be put into `bzrlib.ui.ui_factory`.
133
:param stdin, stdout, stderr: If provided, use these for terminal IO;
134
otherwise use the files in `sys`.
136
# TODO: mention this in a guide to embedding bzrlib
138
# NB: This function tweaks so much global state it's hard to test it in
139
# isolation within the same interpreter. It's not reached on normal
140
# in-process run_bzr calls. If it's broken, we expect that
141
# TestRunBzrSubprocess may fail.
146
bzrlib.trace.enable_default_logging()
147
atexit.register(bzrlib.trace._flush_stdout_stderr)
148
atexit.register(bzrlib.trace._flush_trace)
159
bzrlib.ui.ui_factory = bzrlib.ui.make_ui_for_terminal(
160
stdin, stdout, stderr)
162
if bzrlib.version_info[3] == 'final':
163
from bzrlib.symbol_versioning import suppress_deprecation_warnings
164
suppress_deprecation_warnings(override=True)
166
import bzrlib.osutils
167
atexit.register(osutils.report_extension_load_failures)