[Scipy-svn] r3734 - branches/testing_cleanup/scipy/sandbox/exmplpackage/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Thu Dec 27 03:11:27 EST 2007


Author: fperez
Date: 2007-12-27 02:11:24 -0600 (Thu, 27 Dec 2007)
New Revision: 3734

Modified:
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/test_foo.py
Log:
Add error() function

Modified: branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py	2007-12-27 08:07:00 UTC (rev 3733)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py	2007-12-27 08:11:24 UTC (rev 3734)
@@ -3,7 +3,7 @@
 
 import sys
 
-from numpy.distutils.misc_util import yellow_text
+from numpy.distutils.misc_util import yellow_text, red_text
 from numpy.testing.utils import jiffies
 
 def measure(code_str,times=1,label=None):
@@ -24,10 +24,14 @@
     elapsed = jiffies() - elapsed
     return 0.01*elapsed
 
+def info(message):
+    print >> sys.stdout, message
+    sys.stdout.flush()
+
 def warn(message):
     print >> sys.stderr,yellow_text('Warning: %s' % (message))
     sys.stderr.flush()
 
-def info(message):
-    print >> sys.stdout, message
-    sys.stdout.flush()
+def error(message):
+    print >> sys.stderr,red_text('Error: %s' % (message))
+    sys.stderr.flush()

Modified: branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/test_foo.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/test_foo.py	2007-12-27 08:07:00 UTC (rev 3733)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/test_foo.py	2007-12-27 08:11:24 UTC (rev 3734)
@@ -99,3 +99,7 @@
     "A simple test that prints a warning."
     warn('Bad things are happening...')
     
+def test_error():
+    "A simple test that prints an error message."
+    error('Really bad things are happening...')
+    




More information about the Scipy-svn mailing list