Skip to content

Commit 3be2106

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26600: test: Set wallet type in test_runner when only one type is allowed
fadb869 test: Set wallet type in test_runner when only one type is allowed (MarcoFalke) Pull request description: Currently devs are free to set or not set the wallet type in the test_runner when only one type is allowed to be set. This is inconsistent and causes review comments such as: * bitcoin/bitcoin#24865 (comment) ACKs for top commit: achow101: ACK fadb869 Tree-SHA512: 1ca0946df07b5bf6778fea957d74393757781c324d554fec2f7d03bf1915033e644d9a4c3d77e0b24090ab593d7ed3cb3c9169666bc39fff423706fceaa1af80
2 parents 5690848 + fadb869 commit 3be2106

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,13 @@ def run_test(self):
448448
# Public helper methods. These can be accessed by the subclass test scripts.
449449

450450
def add_wallet_options(self, parser, *, descriptors=True, legacy=True):
451-
group = parser.add_mutually_exclusive_group()
452451
kwargs = {}
453452
if descriptors + legacy == 1:
454453
# If only one type can be chosen, set it as default
455454
kwargs["default"] = descriptors
455+
group = parser.add_mutually_exclusive_group(
456+
# If only one type is allowed, require it to be set in test_runner.py
457+
required=os.getenv("REQUIRE_WALLET_TYPE_SET") == "1" and "default" in kwargs)
456458
if descriptors:
457459
group.add_argument("--descriptors", action='store_const', const=True, **kwargs,
458460
help="Run test using a descriptor wallet", dest='descriptors')

test/functional/test_runner.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import logging
2828
import unittest
2929

30+
os.environ["REQUIRE_WALLET_TYPE_SET"] = "1"
31+
3032
# Formatting. Default colors to empty strings.
3133
DEFAULT, BOLD, GREEN, RED = ("", ""), ("", ""), ("", ""), ("", "")
3234
try:
@@ -159,7 +161,7 @@
159161
'wallet_avoidreuse.py --descriptors',
160162
'wallet_avoid_mixing_output_types.py --descriptors',
161163
'mempool_reorg.py',
162-
'mempool_persist.py',
164+
'mempool_persist.py --descriptors',
163165
'p2p_block_sync.py',
164166
'wallet_multiwallet.py --legacy-wallet',
165167
'wallet_multiwallet.py --descriptors',
@@ -208,7 +210,7 @@
208210
'wallet_keypool.py --legacy-wallet',
209211
'wallet_keypool.py --descriptors',
210212
'wallet_descriptor.py --descriptors',
211-
'wallet_miniscript.py',
213+
'wallet_miniscript.py --descriptors',
212214
'feature_maxtipage.py',
213215
'p2p_nobloomfilter_messages.py',
214216
'p2p_filter.py',
@@ -222,7 +224,7 @@
222224
'feature_assumevalid.py',
223225
'example_test.py',
224226
'wallet_txn_doublespend.py --legacy-wallet',
225-
'wallet_multisig_descriptor_psbt.py',
227+
'wallet_multisig_descriptor_psbt.py --descriptors',
226228
'wallet_txn_doublespend.py --descriptors',
227229
'feature_backwards_compatibility.py --legacy-wallet',
228230
'feature_backwards_compatibility.py --descriptors',
@@ -294,8 +296,8 @@
294296
'wallet_sendall.py --legacy-wallet',
295297
'wallet_sendall.py --descriptors',
296298
'wallet_create_tx.py --descriptors',
297-
'wallet_taproot.py',
298-
'wallet_inactive_hdchains.py',
299+
'wallet_taproot.py --descriptors',
300+
'wallet_inactive_hdchains.py --legacy-wallet',
299301
'p2p_fingerprint.py',
300302
'feature_uacomment.py',
301303
'feature_init.py',

0 commit comments

Comments
 (0)