[python] Replace uses of assert in testsuite

We're not supposed to assert for this, as mentioned in #1488.
This commit is contained in:
Olly Betts 2022-01-30 13:37:19 +13:00
commit 25f996a5c8
3 changed files with 37 additions and 25 deletions

View file

@ -1,10 +1,14 @@
from using_member import *
def swig_assert_equal(a, b):
if a != b:
raise RuntimeError(str(a) + " != " + str(b))
b = B()
assert b.get(int(1)) == 10
assert b.get(float(1)) == 20
swig_assert_equal(b.get(int(1)), 10)
swig_assert_equal(b.get(float(1)), 20)
bb = BB()
assert bb.greater(int(1)) == 0
assert bb.greater(float(1)) == 1
assert bb.great(True) == 2
swig_assert_equal(bb.greater(int(1)), 0)
swig_assert_equal(bb.greater(float(1)), 1)
swig_assert_equal(bb.great(True), 2)