test: add more assert_* methods #18935

pull brakmic wants to merge 1 commits into bitcoin:master from brakmic:new-asserts-for-functional-testing changing 2 files +44 −0
  1. brakmic commented at 3:05 PM on May 10, 2020: contributor

    This PR adds new assert_ methods to functional/test_framework/util.py:

    • assert_not_equal
    • assert_less_than
    • assert_less_than_or_equal

    Additionally, the example_test.py got a new method test_asserts to showcase them. I have searched for test-the-test-showcases but couldn't find any, hence the expansion of example_test.py

    The motivation for this PR is based on my own experience with writing functional tests. From time to time I ran into situations where I wanted to test for something that is not equal X or less than X, but as only assert_equal respective assert_greater_than were available, I had to negate expressions first, before testing them with available asserts:

    assert_equal(negated_expression, False)
    assert_equal(greater_than_expression, False)
    
  2. test: add more assert_* methods 003ab97862
  3. DrahtBot added the label Tests on May 10, 2020
  4. brakmic closed this on May 10, 2020

  5. DrahtBot locked this on Feb 15, 2022
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me