Skip to content

test: replace bare asserts with assertion helpers (assert_equal() etc.) #23119

@theStack

Description

@theStack

#23117 replaced asserts with the test framework's internal helpers (see

def assert_equal(thing1, thing2, *args):
if thing1 != thing2 or any(thing1 != arg for arg in args):
raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
def assert_greater_than(thing1, thing2):
if thing1 <= thing2:
raise AssertionError("%s <= %s" % (str(thing1), str(thing2)))
def assert_greater_than_or_equal(thing1, thing2):
if thing1 < thing2:
raise AssertionError("%s < %s" % (str(thing1), str(thing2)))
) for a single test, in order to see the expected and failed values if such an assertion fails. The same should be done for all the remaining tests. Potential candidates can be found via

$ cd ./test/functional
$ git grep assert.*==
$ git grep "assert.*<="
$ git grep "assert.*>="
$ git grep "assert.*<"
$ git grep "assert.*>"

Useful skills:

basic Python3 knowledge

Want to work on this issue?

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions