CmdTestRunner: add quiet attribute
This commit is contained in:
parent
819202b584
commit
e6758ef1db
6 changed files with 14 additions and 13 deletions
|
|
@ -64,7 +64,7 @@ class CmdTestAutosignBase(CmdTestBase):
|
|||
if trunner is None:
|
||||
return
|
||||
|
||||
self.silent_mount = self.live or not (cfg.exact_output or cfg.verbose)
|
||||
self.silent_mount = self.live or self.tr.quiet
|
||||
self.network_ids = [c+'_tn' for c in self.daemon_coins] + self.daemon_coins
|
||||
|
||||
self._create_autosign_instances(create_dirs=not cfg.skipping_deps)
|
||||
|
|
@ -164,7 +164,7 @@ class CmdTestAutosignBase(CmdTestBase):
|
|||
'hdiutil', 'create', '-size', '10M', '-fs', 'exFAT',
|
||||
'-volname', self.asi.dev_label,
|
||||
str(self.fs_image_path)]
|
||||
redir = None if self.cfg.exact_output or self.cfg.verbose else DEVNULL
|
||||
redir = DEVNULL if self.tr.quiet else None
|
||||
run(cmd, stdout=redir, check=True)
|
||||
|
||||
def _macOS_mount_fs_image(self, loc):
|
||||
|
|
@ -790,7 +790,7 @@ class CmdTestAutosign(CmdTestAutosignBase):
|
|||
self.insert_device()
|
||||
|
||||
silence()
|
||||
self.do_mount(verbose=self.cfg.verbose or self.cfg.exact_output)
|
||||
self.do_mount(verbose=not self.tr.quiet)
|
||||
end_silence()
|
||||
|
||||
for coindir, fn in data:
|
||||
|
|
@ -1074,7 +1074,7 @@ class CmdTestAutosignLive(CmdTestAutosignBTC):
|
|||
no_msg = True,
|
||||
exit_val = 1)
|
||||
|
||||
if not self.cfg.exact_output:
|
||||
if self.tr.quiet:
|
||||
omsg('')
|
||||
|
||||
prompt_insert_sign(t)
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ class CmdTestEthdev(CmdTestBase, CmdTestShared):
|
|||
if not d.id in ('geth', 'erigon'):
|
||||
d.stop(silent=True)
|
||||
d.remove_datadir()
|
||||
d.start( silent = not (self.cfg.verbose or self.cfg.exact_output))
|
||||
d.start(silent=self.tr.quiet)
|
||||
rpc = await self.rpc
|
||||
imsg(f'Daemon: {rpc.daemon.coind_name} v{rpc.daemon_version_str}')
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class CmdTestRunner:
|
|||
self.testing_segwit = cfg.segwit or cfg.segwit_random or cfg.bech32
|
||||
self.network_id = self.proto.coin.lower() + ('_tn' if self.proto.testnet else '')
|
||||
self.daemon_started = False
|
||||
self.quiet = not (cfg.exact_output or cfg.verbose)
|
||||
|
||||
global qmsg, qmsg_r
|
||||
if cfg.exact_output:
|
||||
|
|
@ -96,7 +97,7 @@ class CmdTestRunner:
|
|||
def do_between(self):
|
||||
if self.cfg.pause:
|
||||
confirm_continue()
|
||||
elif (self.cfg.verbose or self.cfg.exact_output) and not self.cfg.skipping_deps:
|
||||
elif not (self.quiet or self.cfg.skipping_deps):
|
||||
sys.stderr.write('\n')
|
||||
|
||||
def set_spawn_env(self):
|
||||
|
|
@ -180,7 +181,7 @@ class CmdTestRunner:
|
|||
|
||||
if not no_msg:
|
||||
t_pfx = '' if self.cfg.no_timings else f'[{time.time() - self.start_time:08.2f}] '
|
||||
if self.cfg.verbose or self.cfg.print_cmdline or self.cfg.exact_output:
|
||||
if (not self.quiet) or self.cfg.print_cmdline:
|
||||
omsg(green(f'{t_pfx}Testing: {desc}'))
|
||||
if not msg_only:
|
||||
clr1, clr2 = (nocolor, nocolor) if self.cfg.print_cmdline else (green, cyan)
|
||||
|
|
|
|||
|
|
@ -539,7 +539,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
desc = 'Unspent outputs',
|
||||
quiet = True,
|
||||
ignore_opt_outdir = True)
|
||||
if self.cfg.verbose or self.cfg.exact_output:
|
||||
if not self.tr.quiet:
|
||||
sys.stderr.write(f'Fake transaction wallet data written to file {self.unspent_data_file!r}\n')
|
||||
|
||||
def _create_fake_unspent_entry(
|
||||
|
|
@ -702,7 +702,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
cmdline_inputs = False,
|
||||
tweaks = []):
|
||||
|
||||
if self.cfg.verbose or self.cfg.exact_output:
|
||||
if not self.tr.quiet:
|
||||
sys.stderr.write(green('Generating fake tracking wallet info\n'))
|
||||
|
||||
silence()
|
||||
|
|
@ -726,7 +726,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared):
|
|||
|
||||
end_silence()
|
||||
|
||||
if self.cfg.verbose or self.cfg.exact_output:
|
||||
if not self.tr.quiet:
|
||||
sys.stderr.write('\n')
|
||||
|
||||
t = self.spawn(
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class CmdTestMisc(CmdTestBase):
|
|||
|
||||
t = self.spawn('test/misc/term_ni.py', ['echo'], cmd_dir='.', pexpect_spawn=True, timeout=1)
|
||||
t.p.logfile = None
|
||||
t.p.logfile_read = sys.stdout if self.cfg.verbose or self.cfg.exact_output else None
|
||||
t.p.logfile_read = None if self.tr.quiet else sys.stdout
|
||||
t.p.logfile_send = None
|
||||
|
||||
test_noecho()
|
||||
|
|
|
|||
|
|
@ -681,14 +681,14 @@ class CmdTestXMRWallet(CmdTestBase):
|
|||
if data.autosign:
|
||||
self.do_umount_online()
|
||||
self.remove_device_online()
|
||||
self.users[user].wd.start(silent=not (self.cfg.exact_output or self.cfg.verbose))
|
||||
self.users[user].wd.start(silent=self.tr.quiet)
|
||||
return data.wd_rpc.call(
|
||||
'open_wallet',
|
||||
filename = os.path.basename(data.walletfile_fs.format(wnum)),
|
||||
password = kal.entry(wnum).wallet_passwd)
|
||||
|
||||
async def stop_wallet_user(self, user):
|
||||
await self.users[user].wd_rpc.stop_daemon(silent=not (self.cfg.exact_output or self.cfg.verbose))
|
||||
await self.users[user].wd_rpc.stop_daemon(silent=self.tr.quiet)
|
||||
return 'ok'
|
||||
|
||||
# mining methods
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue