@@ -103,7 +103,7 @@ def __init__(self, test_file) -> None:
103
103
self .rpc_timeout = 60 # Wait for up to 60 seconds for the RPC server to respond
104
104
self .supports_cli = True
105
105
self .bind_to_localhost_only = True
106
- self .parse_args ()
106
+ self .parse_args (test_file )
107
107
self .default_wallet_name = "default_wallet" if self .options .descriptors else ""
108
108
self .wallet_data_filename = "wallet.dat"
109
109
# Optional list of wallet names that can be set in set_test_params to
@@ -155,14 +155,14 @@ def main(self):
155
155
exit_code = self .shutdown ()
156
156
sys .exit (exit_code )
157
157
158
- def parse_args (self ):
158
+ def parse_args (self , test_file ):
159
159
previous_releases_path = os .getenv ("PREVIOUS_RELEASES_DIR" ) or os .getcwd () + "/releases"
160
160
parser = argparse .ArgumentParser (usage = "%(prog)s [options]" )
161
161
parser .add_argument ("--nocleanup" , dest = "nocleanup" , default = False , action = "store_true" ,
162
162
help = "Leave bitcoinds and test.* datadir on exit or error" )
163
163
parser .add_argument ("--noshutdown" , dest = "noshutdown" , default = False , action = "store_true" ,
164
164
help = "Don't stop bitcoinds after the test execution" )
165
- parser .add_argument ("--cachedir" , dest = "cachedir" , default = os .path .abspath (os .path .dirname (os . path . realpath ( __file__ )) + "/.. /../cache" ),
165
+ parser .add_argument ("--cachedir" , dest = "cachedir" , default = os .path .abspath (os .path .dirname (test_file ) + "/../cache" ),
166
166
help = "Directory for caching pregenerated datadirs (default: %(default)s)" )
167
167
parser .add_argument ("--tmpdir" , dest = "tmpdir" , help = "Root directory for datadirs (must not exist)" )
168
168
parser .add_argument ("-l" , "--loglevel" , dest = "loglevel" , default = "INFO" ,
@@ -177,7 +177,7 @@ def parse_args(self):
177
177
parser .add_argument ("--coveragedir" , dest = "coveragedir" ,
178
178
help = "Write tested RPC commands into this directory" )
179
179
parser .add_argument ("--configfile" , dest = "configfile" ,
180
- default = os .path .abspath (os .path .dirname (os . path . realpath ( __file__ )) + "/.. /../config.ini" ),
180
+ default = os .path .abspath (os .path .dirname (test_file ) + "/../config.ini" ),
181
181
help = "Location of the test framework config file (default: %(default)s)" )
182
182
parser .add_argument ("--pdbonfailure" , dest = "pdbonfailure" , default = False , action = "store_true" ,
183
183
help = "Attach a python debugger if test fails" )
0 commit comments