Skip to content

test: rename assert_greater_than(_or_equal) to assert_gt/assert_ge - #34395

Closed
l0rinc wants to merge 1 commit into
bitcoin:masterfrom
l0rinc:l0rinc/rename-assert-gt-ge
Closed

l0rinc wants to merge 1 commit into
bitcoin:masterfrom
l0rinc:l0rinc/rename-assert-gt-ge

Conversation

@l0rinc

@l0rinc l0rinc commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The functional test framework's assert_greater_than and assert_greater_than_or_equal helper names are verbose, discouraging their use despite providing better error messages for debugging intermittent failures.
They're also using a different nomenclature for comparison than what we're used to on C++ side.

Fix

Rename them to assert_gt and assert_ge via a scripted diff to align with the C++ BOOST_CHECK_GT/BOOST_CHECK_GE naming.

Discussed in #34328 (comment)

@DrahtBot DrahtBot added the Tests label Jan 23, 2026
@DrahtBot

DrahtBot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34395.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept NACK dergoegge

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #bitcoin-core/gui/911 (Adds non-mempool wallet balance to overview by ajtowns)
  • #34286 (test: verify node state after restart in assumeutxo by yashbhutwala)
  • #33671 (wallet: Add separate balance info for non-mempool wallet txs by ajtowns)
  • #33199 (fees: enable CBlockPolicyEstimator return sub 1 sat/vb fee rate estimates by ismaelsadeeq)
  • #32468 (rpc: generateblock to allow multiple outputs by polespinasa)
  • #32138 (wallet, rpc: remove settxfee and paytxfee by polespinasa)
  • #21283 (Implement BIP 370 PSBTv2 by achow101)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Comment thread test/functional/test_framework/util.py Resolved
@dergoegge

Copy link
Copy Markdown
Member

NACK

Sorry for the push back, but I think the subjective benefit here does not outweigh the cost on the project

@l0rinc

l0rinc commented Jan 26, 2026 •

Copy link
Copy Markdown
Contributor Author

the subjective benefit here does not outweigh the cost on the project

what's the cost on the project? I'm unifying python testing nomenclature with the C++ one.

@l0rinc
l0rinc force-pushed the l0rinc/rename-assert-gt-ge branch from d2b531c to ea70e66 Compare January 26, 2026 15:40
…CK equivalents

The functional test framework's `assert_greater_than*` helpers are verbose and noisy at call sites.
Rename them to `assert_gt` and `assert_ge` to align with the C++ `BOOST_CHECK_GT`/`BOOST_CHECK_GE` naming.
The comparison semantics are unchanged.

-BEGIN VERIFY SCRIPT-
git grep -qE "\b(assert_gt|assert_ge)\b" -- test/functional && echo "Error: Target names already exist" >&2 && exit 1
perl -pi -e "s/\bassert_greater_than_or_equal\b/assert_ge/g" $(git grep -l "\bassert_greater_than_or_equal\b" -- test/functional)
perl -pi -e "s/\bassert_greater_than\b/assert_gt/g" $(git grep -l "\bassert_greater_than\b" -- test/functional)
-END VERIFY SCRIPT-
@l0rinc
l0rinc force-pushed the l0rinc/rename-assert-gt-ge branch from ea70e66 to 1f70c30 Compare January 26, 2026 15:46
@dergoegge

Copy link
Copy Markdown
Member

what's the cost on the project? I'm unifying python testing nomenclature with the C++ one.

The cost of reviewing this PR (e.g. #34395 (comment)), and the rebasing this would cause post merge (7 conflicts atm).

@l0rinc

l0rinc commented Jan 26, 2026

Copy link
Copy Markdown
Contributor Author

The cost of reviewing this PR

It's fine if you don't want to invest time in doing or reviewing refactorings, but not sure why you want to stop others from doing so - most of our work is refactoring and cleanup...

@sedited

sedited commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

what's the cost on the project? I'm unifying python testing nomenclature with the C++ one.

I don't think that is worthwhile tbh, or at least it doesn't feel like a sufficient quality of dev experience improvement to me.

@l0rinc

l0rinc commented Jan 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants