forked from LBRYCommunity/lbry-sdk
added support for --no-logging argument to avoid leaking loggers in tests
This commit is contained in:
parent
87c7ce588e
commit
b49275fe6b
2 changed files with 7 additions and 2 deletions
|
@ -187,6 +187,10 @@ def get_argument_parser():
|
|||
'--quiet', dest='quiet', action="store_true",
|
||||
help='Disable all console output.'
|
||||
)
|
||||
start.add_argument(
|
||||
'--no-logging', dest='no_logging', action="store_true",
|
||||
help='Disable all logging of any kind.'
|
||||
)
|
||||
start.add_argument(
|
||||
'--verbose', nargs="*",
|
||||
help=('Enable debug output for lbry logger and event loop. Optionally specify loggers for which debug output '
|
||||
|
@ -261,6 +265,7 @@ def run_daemon(args: argparse.Namespace, conf: Config):
|
|||
loop = asyncio.get_event_loop()
|
||||
if args.verbose is not None:
|
||||
loop.set_debug(True)
|
||||
if not args.no_logging:
|
||||
setup_logging(logging.getLogger(), args, conf)
|
||||
daemon = Daemon(conf)
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ class CLITest(AsyncioTestCase):
|
|||
raise KeyboardInterrupt
|
||||
|
||||
mock_daemon_start.side_effect = side_effect
|
||||
self.shell(["start"])
|
||||
self.shell(["start", "--no-logging"])
|
||||
mock_daemon_start.assert_called_once()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue