From a0fe92f832d5ccae71843655880a548bcae43382 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 11 Oct 2023 12:58:52 +0000 Subject: [PATCH] pylint (test suite) - non-interpolated f-strings --- test/misc/get_passphrase.py | 4 ++-- test/overlay/__init__.py | 2 +- test/test.py | 2 +- test/test_py_d/ts_ethdev.py | 6 +++--- test/test_py_d/ts_misc.py | 10 +++++----- test/test_py_d/ts_regtest.py | 12 ++++++------ test/test_py_d/ts_xmrwallet.py | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/misc/get_passphrase.py b/test/misc/get_passphrase.py index aac60ecc..2ed974f9 100755 --- a/test/misc/get_passphrase.py +++ b/test/misc/get_passphrase.py @@ -11,7 +11,7 @@ from mmgen.util import msg opts_data = { 'text': { 'desc': '', - 'usage': f'crypto | seed', + 'usage': 'crypto | seed', 'options': """ -h, --help Print this help message -P, --passwd-file=f a @@ -57,7 +57,7 @@ def seed(): w2 = Wallet(cfg,ss=w1,passchg=True) msg(f'\n==> got pw,preset,lbl: [{w2.ssdata.passwd}][{w2.ssdata.hash_preset}][{w2.ssdata.label}]\n') - msg(f'------- WALLET FROM FILE -------\n') + msg('------- WALLET FROM FILE -------\n') w3 = Wallet(cfg,fn='test/ref/FE3C6545-D782B529[128,1].mmdat') # passphrase: 'reference password' msg(f'\n==> got pw,preset,lbl: [{w3.ssdata.passwd}][{w3.ssdata.hash_preset}][{w3.ssdata.label}]\n') diff --git a/test/overlay/__init__.py b/test/overlay/__init__.py index 87528a8e..41acb3c3 100644 --- a/test/overlay/__init__.py +++ b/test/overlay/__init__.py @@ -29,7 +29,7 @@ def overlay_setup(repo_root): if ( fn.endswith('.py') or d == f'{pkgname}.data' or - (d == f'mmgen.proto.secp256k1' and fn.startswith('secp256k1')) + (d == 'mmgen.proto.secp256k1' and fn.startswith('secp256k1')) ): if os.path.exists(os.path.join(fakemod_dir,fn)): make_link( diff --git a/test/test.py b/test/test.py index 9b6c4e28..f55d6ed1 100755 --- a/test/test.py +++ b/test/test.py @@ -572,7 +572,7 @@ class TestSuiteRunner: self.pre_args = ['python3'] if gc.platform == 'win' else [] if cfg.pexpect_spawn: - omsg(f'INFO → Using pexpect.spawn() for real terminal emulation') + omsg('INFO → Using pexpect.spawn() for real terminal emulation') self.set_spawn_env() diff --git a/test/test_py_d/ts_ethdev.py b/test/test_py_d/ts_ethdev.py index b2f7b8a6..d79e8bcd 100755 --- a/test/test_py_d/ts_ethdev.py +++ b/test/test_py_d/ts_ethdev.py @@ -958,7 +958,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared): imsg(f'Gas used: {res.gas_used.hl():<9} {(res.gas_used*res.gas_price).hl2(encl="()")}') imsg(f'Gas price: {res.gas_price.hl()}') if res.gas_used == res.gas_sent: - omsg(yellow(f'Warning: all gas was used!')) + omsg(yellow('Warning: all gas was used!')) return res async def token_deploy(self,num,key,gas,mmgen_cmd='txdo',tx_fee='8G'): @@ -1410,7 +1410,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared): self.spawn('',msg_only=True) from mmgen.tw.ctl import TwCtl twctl = await TwCtl(cfg,self.proto) - imsg(f'Moving tracking wallet') + imsg('Moving tracking wallet') bakfile = twctl.tw_fn + '.bak.json' if os.path.exists(bakfile): os.unlink(bakfile) @@ -1443,7 +1443,7 @@ class TestSuiteEthdev(TestSuiteBase,TestSuiteShared): from mmgen.tw.ctl import TwCtl twctl = await TwCtl(cfg,self.proto) fn = twctl.tw_fn - imsg(f'Comparing imported tracking wallet with original') + imsg('Comparing imported tracking wallet with original') data = [json.dumps(json.loads(read_from_file(f)),sort_keys=True) for f in (fn,fn+'.bak.json')] cmp_or_die(*data,'tracking wallets') return 'ok' diff --git a/test/test_py_d/ts_misc.py b/test/test_py_d/ts_misc.py index d0e6fe6e..5ccade01 100755 --- a/test/test_py_d/ts_misc.py +++ b/test/test_py_d/ts_misc.py @@ -54,7 +54,7 @@ class TestSuiteMisc(TestSuiteBase): def xmrwallet_txview(self,op='txview'): files = get_file_with_ext('test/ref/monero','tx',no_dot=True,delete=False,return_list=True) - t = self.spawn( f'mmgen-xmrwallet', [op] + files ) + t = self.spawn( 'mmgen-xmrwallet', [op] + files ) res = t.read(strip_color=True) if op == 'txview': for s in ( @@ -75,7 +75,7 @@ class TestSuiteMisc(TestSuiteBase): else: coins = ['btc','ltc','eth'] start_test_daemons('ltc','eth') - t = self.spawn(f'examples/coin-daemon-info.py',coins,cmd_dir='.') + t = self.spawn('examples/coin-daemon-info.py',coins,cmd_dir='.') for coin in coins: t.expect(coin.upper() + r'\s+mainnet\s+Up',regex=True) if cfg.pexpect_spawn: @@ -137,20 +137,20 @@ class TestSuiteHelp(TestSuiteBase): ) def usage(self): - t = self.spawn(f'mmgen-walletgen',['foo']) + t = self.spawn('mmgen-walletgen',['foo']) t.expect('MMGenSystemExit(1)') t.expect('USAGE: mmgen-walletgen') t.req_exit_val = 1 return t def version(self): - t = self.spawn(f'mmgen-tool',['--version']) + t = self.spawn('mmgen-tool',['--version']) t.expect('MMGEN-TOOL version') return t def license(self): t = self.spawn( - f'mmgen-walletconv', + 'mmgen-walletconv', ['--stdout','--in-fmt=hex','--out-fmt=hex'], env = {'MMGEN_NO_LICENSE':''} ) t.expect('to continue: ', 'w') diff --git a/test/test_py_d/ts_regtest.py b/test/test_py_d/ts_regtest.py index ea0a3677..6043b525 100755 --- a/test/test_py_d/ts_regtest.py +++ b/test/test_py_d/ts_regtest.py @@ -598,7 +598,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared): if batch: t.expect(f'{num_addrs} addresses imported') else: - t.expect(f'import completed OK') + t.expect('import completed OK') t.ok() t.skip_ok = True @@ -654,11 +654,11 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared): rt = MMGenRegtest(cfg,self.proto.coin) await rt.stop() from shutil import rmtree - imsg(f'Deleting Bob’s old tracking wallet') + imsg('Deleting Bob’s old tracking wallet') rmtree(os.path.join(rt.d.datadir,'regtest','wallets','bob'),ignore_errors=True) rt.init_daemon() rt.d.start(silent=True) - imsg(f'Creating Bob’s new tracking wallet') + imsg('Creating Bob’s new tracking wallet') await rt.rpc_call('createwallet','bob',True,True,None,False,False,False) await rt.stop() await rt.start() @@ -1303,7 +1303,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared): assert self.proto.cap('segwit') if not hasattr(self,'_b_start_'): t = self.spawn( 'mmgen-tool', ['--color=0','--bob','listaddresses'], no_msg=True ) - self._b_start_ = int([e for e in t.read().split('\n') if f':B:1' in e][0].split()[0].rstrip(')')) + self._b_start_ = int([e for e in t.read().split('\n') if ':B:1' in e][0].split()[0].rstrip(')')) t.close() return self._b_start_ @@ -1389,14 +1389,14 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared): return self.spawn('mmgen-tool',['--carol','listaddresses','showempty=1']) async def carol_delete_wallet(self): - imsg(f'Unloading Carol’s tracking wallet') + imsg('Unloading Carol’s tracking wallet') t = self.spawn('mmgen-regtest',['cli','unloadwallet','carol']) t.ok() from mmgen.rpc import rpc_init rpc = await rpc_init(cfg,self.proto) wdir = joinpath(rpc.daemon.network_datadir,'wallets','carol') from shutil import rmtree - imsg(f'Deleting Carol’s tracking wallet') + imsg('Deleting Carol’s tracking wallet') rmtree(wdir) return 'silent' diff --git a/test/test_py_d/ts_xmrwallet.py b/test/test_py_d/ts_xmrwallet.py index 3d1e6bd5..beab396b 100755 --- a/test/test_py_d/ts_xmrwallet.py +++ b/test/test_py_d/ts_xmrwallet.py @@ -783,7 +783,7 @@ class TestSuiteXMRWallet(TestSuiteBase): t = tool_api(cfg) t.init_coin('XMR','mainnet') t.usr_randchars = 0 - imsg_r(f'Sending random transactions: ') + imsg_r('Sending random transactions: ') for i in range(random_txs): await self.transfer( 'miner',