mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-15 00:59:38 +02:00
test: prep manual equality assert conversions
The later scripted diff only handles plain `assert x == y` lines. Some remaining tests still use equality inside comprehensions, parenthesized asserts, and other shapes that the line-based rewrite would misread. Rewrite those sites by hand first so the later mechanical conversion stays safe. The commit also simplifies the dead `len(["errors"]) == 0` branch in `blocktools.py`, which can never be true.
This commit is contained in:
@@ -179,7 +179,7 @@ class MempoolLimitTest(BitcoinTestFramework):
|
||||
# Package should be submitted, temporarily exceeding maxmempool, and then evicted.
|
||||
res = node.submitpackage(package_hex)
|
||||
assert_equal(res["package_msg"], "transaction failed")
|
||||
assert len([tx_res for _, tx_res in res["tx-results"].items() if "error" in tx_res and tx_res["error"] == "bad-txns-inputs-missingorspent"])
|
||||
assert "bad-txns-inputs-missingorspent" in [tx_res["error"] for _, tx_res in res["tx-results"].items() if "error" in tx_res]
|
||||
|
||||
# Maximum size must never be exceeded.
|
||||
assert_greater_than(node.getmempoolinfo()["maxmempool"], node.getmempoolinfo()["bytes"])
|
||||
|
||||
Reference in New Issue
Block a user