Fix python default_args testcase for Python 3

Changes for the default_args testcase to run under Python 3 when called
from python_default_args testcase
This commit is contained in:
William S Fulton 2015-01-08 23:54:50 +00:00
commit efb8784c8b
2 changed files with 11 additions and 11 deletions

View file

@ -2,10 +2,9 @@
def run(module_name):
default_args = __import__(module_name)
print "running...."
ec = default_args.EnumClass()
if not ec.blah():
raise RuntimeError,"EnumClass::blah() default arguments don't work"
raise RuntimeError("EnumClass::blah() default arguments don't work")
de = default_args.DerivedEnumClass()
de.accelerate()
@ -35,51 +34,51 @@ def run(module_name):
error = 1
except:
error = 0
if error: raise RuntimeError,"Foo::Foo ignore is not working"
if error: raise RuntimeError("Foo::Foo ignore is not working")
try:
f = default_args.Foo(1,2)
error = 1
except:
error = 0
if error: raise RuntimeError,"Foo::Foo ignore is not working"
if error: raise RuntimeError("Foo::Foo ignore is not working")
try:
f = default_args.Foo(1,2,3)
error = 1
except:
error = 0
if error: raise RuntimeError,"Foo::Foo ignore is not working"
if error: raise RuntimeError("Foo::Foo ignore is not working")
try:
m = f.meth(1)
error = 1
except:
error = 0
if error: raise RuntimeError,"Foo::meth ignore is not working"
if error: raise RuntimeError("Foo::meth ignore is not working")
try:
m = f.meth(1,2)
error = 1
except:
error = 0
if error: raise RuntimeError,"Foo::meth ignore is not working"
if error: raise RuntimeError("Foo::meth ignore is not working")
try:
m = f.meth(1,2,3)
error = 1
except:
error = 0
if error: raise RuntimeError,"Foo::meth ignore is not working"
if error: raise RuntimeError("Foo::meth ignore is not working")
if default_args.Klass.inc(100, default_args.Klass(22)).val != 122:
raise RuntimeError, "Klass::inc failed"
raise RuntimeError("Klass::inc failed")
if default_args.Klass.inc(100).val != 99:
raise RuntimeError, "Klass::inc failed"
raise RuntimeError("Klass::inc failed")
if default_args.Klass.inc().val != 0:
raise RuntimeError, "Klass::inc failed"
raise RuntimeError("Klass::inc failed")
default_args.trickyvalue1(10); default_args.trickyvalue1(10, 10)
default_args.trickyvalue2(10); default_args.trickyvalue2(10, 10)