mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 17:53:04 +02:00
refactor: test: use _ variable for unused loop counters
substitutes "for x in range(N):" by "for _ in range(N):" indicates to the reader that a block is just repeated N times, and that the loop counter is not used in the body
This commit is contained in:
@@ -107,7 +107,7 @@ class WalletDescriptorTest(BitcoinTestFramework):
|
||||
assert_equal(info2['desc'], info3['desc'])
|
||||
|
||||
self.log.info("Test that getnewaddress still works after keypool is exhausted in an encrypted wallet")
|
||||
for i in range(0, 500):
|
||||
for _ in range(500):
|
||||
send_wrpc.getnewaddress()
|
||||
|
||||
self.log.info("Test that unlock is needed when deriving only hardened keys in an encrypted wallet")
|
||||
@@ -120,7 +120,7 @@ class WalletDescriptorTest(BitcoinTestFramework):
|
||||
}])
|
||||
send_wrpc.walletlock()
|
||||
# Exhaust keypool of 100
|
||||
for i in range(0, 100):
|
||||
for _ in range(100):
|
||||
send_wrpc.getnewaddress(address_type='bech32')
|
||||
# This should now error
|
||||
assert_raises_rpc_error(-12, "Keypool ran out, please call keypoolrefill first", send_wrpc.getnewaddress, '', 'bech32')
|
||||
|
Reference in New Issue
Block a user