test: remove the lazy import of util in authproxy
What changed, and why it matters
This is a minor code cleanup in Bitcoin Core's test framework. It removes a lazy (deferred) import and replaces it with a normal import at the top of the file. There is no security issue here—it's purely a refactoring change to simplify the code after an earlier dependency cleanup.
No action needed. This is a non-security refactoring change in test code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/test_framework/authproxy.py. Previously, assert_equal was imported lazily inside an else branch. Now it is imported normally alongside JSONRPCException at the top of the file. This eliminates a circular-dependency workaround and has no functional or security impact.
Changed components
test/functional/test_framework/authproxy.pyInspect captured patch +1 / −2
diff --git a/test/functional/test_framework/authproxy.py b/test/functional/test_framework/authproxy.py
index 3d263a64..0377414a 100644
--- a/test/functional/test_framework/authproxy.py
+++ b/test/functional/test_framework/authproxy.py
@@ -44,7 +44,7 @@ import socket
import time
import urllib.parse
-from .util import JSONRPCException
+from .util import JSONRPCException, assert_equal
HTTP_TIMEOUT = 30
USER_AGENT = "AuthServiceProxy/0.1"
@@ -139,7 +139,6 @@ class AuthServiceProxy():
else:
return response['result']
else:
- from .util import assert_equal
assert_equal(response['jsonrpc'], '2.0')
if status != HTTPStatus.OK:
raise JSONRPCException({
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.