swig/Examples/test-suite/python/inplaceadd_runme.py
William S Fulton 365d4961d4 Remove print statements from Python tests
Use exceptions instead of printing to stdout.
Part of an effort to convert Python tests to python 3 syntax.
2020-08-13 21:22:47 +01:00

19 lines
253 B
Python

import inplaceadd
a = inplaceadd.A(7)
a += 5
if a.val != 12:
raise RuntimeError("a.val: {}".format(a.val))
a -= 5
if a.val != 7:
raise RuntimeError
a *= 2
if a.val != 14:
raise RuntimeError
a += a
if a.val != 28:
raise RuntimeError