mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 09:46:14 +00:00
Normally, when a symlinked test script is executed directly (e.g., `./bld-cmake/test/functional/wallet_disable.py`), Python's default behavior is to resolve the symlink of the script itself, setting `sys.path[0]` to the directory containing the physical source file. Consequently, the test framework util.py is imported from the source tree, and `Path(__file__).parents[3]` correctly resolves to the source root. However, `feature_framework_testshell.py` is unique because it manually inserts `Path(__file__).parent` into `sys.path`. That refers to the build tree and when importing the test framework util.py, the `Path(__file__).parents[3]` will incorrectly point to the build directory instead of the source root. Use `.resolve()` to ensure the Valgrind suppressions file path is always calculated relative to the physical source file, regardless of how the framework was imported.