swig/Examples/test-suite/python/constover_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

29 lines
650 B
Python

import constover
import sys
error = 0
p = constover.test("test")
if p != "test":
raise RuntimeError("test failed!")
p = constover.test_pconst("test")
if p != "test_pconst":
raise RuntimeError("test_pconst failed!")
f = constover.Foo()
p = f.test("test")
if p != "test":
raise RuntimeError("member-test failed!")
p = f.test_pconst("test")
if p != "test_pconst":
raise RuntimeError("member-test_pconst failed!")
p = f.test_constm("test")
if p != "test_constmethod":
raise RuntimeError("member-test_constm failed!")
p = f.test_pconstm("test")
if p != "test_pconstmethod":
raise RuntimeError("member-test_pconstm failed!")