2626import tempfile
2727import re
2828import logging
29- import unittest
3029
3130os .environ ["REQUIRE_WALLET_TYPE_SET" ] = "1"
3231
7069TEST_EXIT_PASSED = 0
7170TEST_EXIT_SKIPPED = 77
7271
73- # List of framework modules containing unit tests. Should be kept in sync with
74- # the output of `git grep unittest.TestCase ./test/functional/test_framework`
75- TEST_FRAMEWORK_MODULES = [
76- "address" ,
77- "crypto.bip324_cipher" ,
78- "blocktools" ,
79- "crypto.chacha20" ,
80- "crypto.ellswift" ,
81- "key" ,
82- "messages" ,
83- "crypto.muhash" ,
84- "crypto.poly1305" ,
85- "crypto.ripemd160" ,
86- "script" ,
87- "segwit_addr" ,
88- "wallet_util" ,
89- ]
72+ TEST_FRAMEWORK_UNIT_TESTS = 'feature_framework_unit_tests.py'
9073
9174EXTENDED_SCRIPTS = [
9275 # These tests are not run by default.
255238 'wallet_keypool.py --descriptors' ,
256239 'wallet_descriptor.py --descriptors' ,
257240 'p2p_nobloomfilter_messages.py' ,
241+ TEST_FRAMEWORK_UNIT_TESTS ,
258242 'p2p_filter.py' ,
259243 'rpc_setban.py --v1transport' ,
260244 'rpc_setban.py --v2transport' ,
@@ -440,7 +424,6 @@ def main():
440424 parser .add_argument ('--tmpdirprefix' , '-t' , default = tempfile .gettempdir (), help = "Root directory for datadirs" )
441425 parser .add_argument ('--failfast' , '-F' , action = 'store_true' , help = 'stop execution after the first test failure' )
442426 parser .add_argument ('--filter' , help = 'filter scripts to run by regular expression' )
443- parser .add_argument ('--skipunit' , '-u' , action = 'store_true' , help = 'skip unit tests for the test framework' )
444427
445428
446429 args , unknown_args = parser .parse_known_args ()
@@ -552,10 +535,9 @@ def main():
552535 combined_logs_len = args .combinedlogslen ,
553536 failfast = args .failfast ,
554537 use_term_control = args .ansi ,
555- skipunit = args .skipunit ,
556538 )
557539
558- def run_tests (* , test_list , src_dir , build_dir , tmpdir , jobs = 1 , enable_coverage = False , args = None , combined_logs_len = 0 , failfast = False , use_term_control , skipunit = False ):
540+ def run_tests (* , test_list , src_dir , build_dir , tmpdir , jobs = 1 , enable_coverage = False , args = None , combined_logs_len = 0 , failfast = False , use_term_control ):
559541 args = args or []
560542
561543 # Warn if bitcoind is already running
@@ -578,15 +560,6 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
578560 # a hard link or a copy on any platform. See https://github.com/bitcoin/bitcoin/pull/27561.
579561 sys .path .append (tests_dir )
580562
581- if not skipunit :
582- print ("Running Unit Tests for Test Framework Modules" )
583- test_framework_tests = unittest .TestSuite ()
584- for module in TEST_FRAMEWORK_MODULES :
585- test_framework_tests .addTest (unittest .TestLoader ().loadTestsFromName ("test_framework.{}" .format (module )))
586- result = unittest .TextTestRunner (verbosity = 1 , failfast = True ).run (test_framework_tests )
587- if not result .wasSuccessful ():
588- sys .exit ("Early exiting after failure in TestFramework unit tests" )
589-
590563 flags = ['--cachedir={}' .format (cache_dir )] + args
591564
592565 if enable_coverage :
0 commit comments