diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2024-08-25 20:57:22 +0200 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-08-30 11:07:00 +0100 |
commit | 5577d5a3c0904a4805e7b768cb60144daa2a0854 (patch) | |
tree | 189e4d74449057ff2313e9b752e58731e5f6679e | |
parent | 88f0419c1ab1e5f3ccf425435e530d8ceb72c7f1 (diff) |
test: fix `TestShell` initialization (late follow-up for #30463)
Github-Pull: #30714
Rebased-From: bd7ce05f9d9d21903163a2bd9dd2df3ed3990c3e
-rw-r--r-- | test/functional/test_framework/test_shell.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/test_framework/test_shell.py b/test/functional/test_framework/test_shell.py index 09ccec28a1..e232430507 100644 --- a/test/functional/test_framework/test_shell.py +++ b/test/functional/test_framework/test_shell.py @@ -2,9 +2,11 @@ # Copyright (c) 2019-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. +import pathlib from test_framework.test_framework import BitcoinTestFramework + class TestShell: """Wrapper Class for BitcoinTestFramework. @@ -67,7 +69,13 @@ class TestShell: # This implementation enforces singleton pattern, and will return the # previously initialized instance if available if not TestShell.instance: - TestShell.instance = TestShell.__TestShell() + # BitcoinTestFramework instances are supposed to be constructed with the path + # of the calling test in order to find shared data like configuration and the + # cache. Since TestShell is meant for interactive use, there is no concrete + # test; passing a dummy name is fine though, as only the containing directory + # is relevant for successful initialization. + tests_directory = pathlib.Path(__file__).resolve().parent.parent + TestShell.instance = TestShell.__TestShell(tests_directory / "testshell_dummy.py") TestShell.instance.running = False return TestShell.instance |