changeset 62:8135e840ef0e pytave-tests

Cherry-picking test changes
author David Grundberg <individ@acc.umu.se>
date Mon, 08 Jun 2009 20:53:58 +0200
parents bb7c52547fcf (current diff) 46e6fa692e0c (diff)
children 590cd2fedcc1
files test/test.py
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/test.py	Mon Jun 08 20:51:11 2009 +0200
+++ b/test/test.py	Mon Jun 08 20:53:58 2009 +0200
@@ -124,20 +124,20 @@
 	try:
 		variables[name] = value
 		if name not in variables:
-			print "FAIL: set/get: ", name,": Should exist, not there."
+			fail("set/get: %s: Should exist, not there." % name)
 		result, = pytave.feval(1, "isequal", value, variables[name])
 		if not result:
-			print "FAIL: set/get: ", name," -> ",value," results diverged"
+			fail("set/get: %s -> %s: results diverged" % (name, value))
 	except Exception, e:
-		print "FAIL: set/get: ", name, ":", e
+		fail("set/get: %s" % name, e)
 
 def testexception(exception, func):
 	try:
 		func()
-		print "FAIL: ", name
+		fail("Expecting %s but nothing was raised." % repr(exception))
 	except Exception, e:
 		if not isinstance(e, exception):
-			print "FAIL:", name, ":", e
+			fail("Expecting %s but got %s instead" % (repr(exception), repr(e)), e)
 
 def testlocalscope(x):
 
@@ -163,7 +163,6 @@
     except Exception, e:
 	fail("testlocalscope: %s" % (x,), e)
 
-
 testmatrix(alimit_int32)
 testmatrix(alimit_int16)
 testmatrix(alimit_int8)
@@ -252,8 +251,6 @@
 testparseerror(1, "endfunction")
 testevalexpect(1, "2 + 2", (4,))
 testevalexpect(1, "{2}", ([2],))
-
-# FIXME
 testevalexpect(1, "struct('foo', 2)", ({'foo': 2},))
 
 testsetget(pytave.locals, "xxx", [1,2,3])