test: add missing `assert_equal` imports
What changed, and why it matters
This commit only adds missing Python imports for a helper function named assert_equal in test files. It does not change how Bitcoin Core runs, validates transactions, or handles user funds. It is a routine test-code cleanup with no security relevance.
No action required. This is a benign test-only import cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds from test_framework.util import assert_equal (or combines it with existing imports) in ten functional test files. The commit message explains this is preparation for a later scripted diff that will mechanically replace call sites. No runtime code, consensus logic, cryptography, or network handling is modified.
Changed components
test/functional/data/invalid_txs.pytest/functional/feature_posix_fs_permissions.pytest/functional/feature_reindex_readonly.pytest/functional/mining_getblocktemplate_longpoll.pytest/functional/p2p_handshake.pytest/functional/test_framework/crypto/ellswift.pytest/functional/test_framework/crypto/secp256k1.pytest/functional/test_framework/key.pytest/functional/test_framework/psbt.pytest/functional/wallet_disable.pyInspect captured patch +10 / −5
diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py
index 3903bf9d..7a769922 100644
--- a/test/functional/data/invalid_txs.py
+++ b/test/functional/data/invalid_txs.py
@@ -58,6 +58,7 @@ from test_framework.script import (
OP_SUBSTR,
OP_XOR,
)
+from test_framework.util import assert_equal
from test_framework.script_util import (
MIN_PADDING,
MIN_STANDARD_TX_NONWITNESS_SIZE,
diff --git a/test/functional/feature_posix_fs_permissions.py b/test/functional/feature_posix_fs_permissions.py
index e1884694..5fc82c26 100755
--- a/test/functional/feature_posix_fs_permissions.py
+++ b/test/functional/feature_posix_fs_permissions.py
@@ -9,6 +9,7 @@ import os
import stat
from test_framework.test_framework import BitcoinTestFramework
+from test_framework.util import assert_equal
class PosixFsPermissionsTest(BitcoinTestFramework):
diff --git a/test/functional/feature_reindex_readonly.py b/test/functional/feature_reindex_readonly.py
index 858a6756..6f088e4a 100755
--- a/test/functional/feature_reindex_readonly.py
+++ b/test/functional/feature_reindex_readonly.py
@@ -10,6 +10,7 @@ import os
import stat
import subprocess
from test_framework.test_framework import BitcoinTestFramework
+from test_framework.util import assert_equal
class BlockstoreReindexTest(BitcoinTestFramework):
diff --git a/test/functional/mining_getblocktemplate_longpoll.py b/test/functional/mining_getblocktemplate_longpoll.py
index 42111696..db547971 100755
--- a/test/functional/mining_getblocktemplate_longpoll.py
+++ b/test/functional/mining_getblocktemplate_longpoll.py
@@ -8,7 +8,7 @@ import random
import threading
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import get_rpc_proxy
+from test_framework.util import assert_equal, get_rpc_proxy
from test_framework.wallet import MiniWallet
diff --git a/test/functional/p2p_handshake.py b/test/functional/p2p_handshake.py
index 774ab429..a05c072b 100755
--- a/test/functional/p2p_handshake.py
+++ b/test/functional/p2p_handshake.py
@@ -9,7 +9,7 @@ import itertools
import time
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_not_equal
+from test_framework.util import assert_equal, assert_not_equal
from test_framework.messages import (
NODE_NETWORK,
NODE_NETWORK_LIMITED,
diff --git a/test/functional/test_framework/crypto/ellswift.py b/test/functional/test_framework/crypto/ellswift.py
index 2a2caa81..db48dd24 100644
--- a/test/functional/test_framework/crypto/ellswift.py
+++ b/test/functional/test_framework/crypto/ellswift.py
@@ -13,6 +13,7 @@ import random
import unittest
from test_framework.crypto.secp256k1 import FE, G, GE
+from test_framework.util import assert_equal
# Precomputed constant square root of -3 (mod p).
MINUS_3_SQRT = FE(-3).sqrt()
diff --git a/test/functional/test_framework/crypto/secp256k1.py b/test/functional/test_framework/crypto/secp256k1.py
index 479d046f..b7193d46 100644
--- a/test/functional/test_framework/crypto/secp256k1.py
+++ b/test/functional/test_framework/crypto/secp256k1.py
@@ -17,7 +17,7 @@ Exports:
import unittest
from hashlib import sha256
-from test_framework.util import assert_not_equal
+from test_framework.util import assert_equal, assert_not_equal
class FE:
"""Objects of this class represent elements of the field GF(2**256 - 2**32 - 977).
diff --git a/test/functional/test_framework/key.py b/test/functional/test_framework/key.py
index 6caafe8b..1e963dd3 100644
--- a/test/functional/test_framework/key.py
+++ b/test/functional/test_framework/key.py
@@ -14,7 +14,7 @@ import random
import unittest
from test_framework.crypto import secp256k1
-from test_framework.util import assert_not_equal, random_bitflip
+from test_framework.util import assert_equal, assert_not_equal, random_bitflip
# Point with no known discrete log.
H_POINT = "50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0"
diff --git a/test/functional/test_framework/psbt.py b/test/functional/test_framework/psbt.py
index 8c552e42..5790d634 100644
--- a/test/functional/test_framework/psbt.py
+++ b/test/functional/test_framework/psbt.py
@@ -5,6 +5,7 @@
import base64
+from .util import assert_equal
from .messages import (
CTransaction,
deser_string,
diff --git a/test/functional/wallet_disable.py b/test/functional/wallet_disable.py
index dbcccd47..46b92ad5 100755
--- a/test/functional/wallet_disable.py
+++ b/test/functional/wallet_disable.py
@@ -9,7 +9,7 @@
"""
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_raises_rpc_error
+from test_framework.util import assert_raises_rpc_error, assert_equal
class DisableWalletTest (BitcoinTestFramework):
def set_test_params(self):
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.