[Scipy-svn] r3811 - in branches/testing_cleanup/scipy/sandbox: exmplpackage exmplpackage/tests timeseries/lib/tests

scipy-svn@scip... scipy-svn@scip...
Wed Jan 9 18:45:45 CST 2008


Author: matthew.brett@gmail.com
Date: 2008-01-09 18:45:34 -0600 (Wed, 09 Jan 2008)
New Revision: 3811

Removed:
   branches/testing_cleanup/scipy/sandbox/exmplpackage/__init__.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/foo.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/info_exmplpackage.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/setup.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/spam_src.pyf
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/decorators.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/tstsupport.py
   branches/testing_cleanup/scipy/sandbox/exmplpackage/yyy/
Modified:
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/README.txt
   branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/test_foo.py
   branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py
   branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py
Log:
Cleaned out example package, fixed timeseries tests

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/__init__.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/__init__.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/__init__.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,15 +0,0 @@
-#
-# exmplpackage - Example of a Scipy module, see DEVELOPERS.txt
-#
-
-# Get documentation string:
-from info_exmplpackage import __doc__
-
-# Import symbols from sub-module:
-from foo import *
-
-# Import sub-package:
-import yyy
-
-# Import extension module
-import spam

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/foo.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/foo.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/foo.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,17 +0,0 @@
-"""
-foo - Scipy module exmplpackage submodule.
-"""
-
-__all__ = ['exmplpackage_foo_bar','foo_gun']
-
-def exmplpackage_foo_bar():
-    """
-    Scipy module exmplpackage global (see info_exmplpackage.py) test function.
-    """
-    return "Hello from exmplpackage_foo_bar"
-
-def foo_gun():
-    """
-    Scipy module exmplpackage test function.
-    """
-    return "Hello from foo_gun"

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/info_exmplpackage.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/info_exmplpackage.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/info_exmplpackage.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,13 +0,0 @@
-"""
-Scipy example module for developers
-
-This is documentation of exmplpackage.
-Provides:
-  exmplpackage_foo_bar - also available in scipy name space
-  foo_gun
-  yyy.fun
-"""
-
-global_symbols = ['exmplpackage_foo_bar']
-
-postpone_import = 1

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/setup.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/setup.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/setup.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-
-from os.path import join
-
-def configuration(parent_package='',top_path=None):
-    # The following two lines with `return config` constitutes a
-    # minimal contents of configuration(..) that is suitable for pure
-    # Python packages.
-    from numpy.distutils.misc_util import Configuration
-    config = Configuration('exmplpackage',parent_package,top_path)
-
-    # include test scripts from tests
-    config.add_data_dir('tests')
-
-    # exmplpackage contains Python sub-package yyy
-    config.add_subpackage('yyy')
-
-    # exmplpackage generates source code, that will be processed with f2py
-    def generate_spam_pyf(ext, build_dir):
-        from distutils.dep_util import newer
-        target = join(build_dir,'spam.pyf')
-        source = ext.depends[0]
-        if newer(source,target):
-            fin = open(source)
-            body = fin.read()
-            fin.close()
-            fout = open(target,'w')
-            fout.write('python module spam\n%s\nend python module spam' % body)
-            fout.close()
-        return target
-    config.add_extension('spam',
-                         sources = [generate_spam_pyf],
-                         depends = ['spam_src.pyf'])
-
-    return config
-
-if __name__ == '__main__':
-    from numpy.distutils.core import setup
-    setup(**configuration(top_path='').todict())

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/spam_src.pyf
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/spam_src.pyf	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/spam_src.pyf	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,13 +0,0 @@
-usercode '''
-static char doc_spam_incr[] = "Return incremented argument";
-static PyObject *spam_incr(PyObject *self, PyObject *args)
-{
-  int input;
-  if (!PyArg_ParseTuple(args, "i", &input))
-    return NULL;
-  return Py_BuildValue("i", input+1);
-}
-'''
-pymethoddef '''
-{"incr",  spam_incr, METH_VARARGS, doc_spam_incr},
-'''

Modified: branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/README.txt
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/README.txt	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/README.txt	2008-01-10 00:45:34 UTC (rev 3811)
@@ -47,11 +47,13 @@
 and performs tests per level
 
 import scipy.mypackage
-scipy.mypackage.test() # all unlabeled tests 
-scipy.mypackage.test('all') # unlabeled, labeled and doctests
-scipy.mypackage.test(10) # as above, for compatibility, deprecated
-scipy.mypackage.test(['slow']) # just slow tests
-scipy.mypackage.test(['', 'slow']) # unlabeled and slow tests
+scipy.mypackage.test() # fast, unlabeled tests 
+scipy.mypackage.test('full') # unlabeled, not slow, not villfail
+scipy.mypackage.test('slow') # just slow tests
+scipy.mypackage.test('bench') # just benchmarks
+scipy.mypackage.test(None) # all possible tests, including benchmarks
+scipy.mypackage.test(doctests=True) # fast tests, with doctests
+
 At the base level, scipy.test(*args) collects the test suite from each
 package, and runs it, with *args as above.
 

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/decorators.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/decorators.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/decorators.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,13 +0,0 @@
-"""Decorators for labeling test objects."""
-
-def slow(t):
-    """Labels a test as 'slow'.
-
-    The exact definition of a slow test is obviously both subjective and
-    hardware-dependent, but in general any individual test that requires more
-    than a second or two should be labeled as slow (the whole suite consits of
-    thousands of tests, so even a second is significant)."""
-    
-    t.slow = True
-    return t
-

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/ntest.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,37 +0,0 @@
-"""Simple testing utilities, to eventually be put into numpy.testing
-"""
-
-import sys
-
-from numpy.distutils.misc_util import yellow_text, red_text
-from numpy.testing.utils import jiffies
-
-def measure(code_str,times=1,label=None):
-    """ Return elapsed time for executing code_str in the
-    namespace of the caller for given times.
-    """
-    frame = sys._getframe(1)
-    locs,globs = frame.f_locals,frame.f_globals
-
-    code = compile(code_str,
-                   'Test name: %s ' % label,
-                   'exec')
-    i = 0
-    elapsed = jiffies()
-    while i<times:
-        i += 1
-        exec code in globs,locs
-    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 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	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/test_foo.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -25,7 +25,7 @@
 
 # This single import statement should provide all the common functionality for
 # scipy tests in a single location.
-from tstsupport import *
+from scipy.testing import *
 
 def setup():
     """Module-level setup"""

Deleted: branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/tstsupport.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/tstsupport.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/exmplpackage/tests/tstsupport.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -1,15 +0,0 @@
-"""Common test support for all scipy test scripts.
-
-This single module should provide all the common functionality for scipy tests
-in a single location, so that test script can just import it and work right
-away.
-"""
-
-from unittest import TestCase
-
-import nose
-
-# These two modules will need to be later put in the right places...
-import decorators as dec
-
-from ntest import *

Modified: branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_interpolate.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -13,13 +13,13 @@
 
 from scipy.testing import *
 
-import scipy.sandbox.maskedarray.testutils
-from import scipy.sandbox.maskedarray.testutils import *
+from scipy.sandbox.maskedarray.testutils import *
 
-import maskedarray.core as coremodule
-from maskedarray.core import MaskedArray, masked
+import scipy.sandbox.maskedarray.core as coremodule
+from scipy.sandbox.maskedarray.core import MaskedArray, masked
 
-from timeseries.lib.interpolate import backward_fill, forward_fill, interp_masked1d
+from scipy.sandbox.timeseries.lib.interpolate import \
+     backward_fill, forward_fill, interp_masked1d
 
 class TestFuncs(TestCase):
 

Modified: branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py
===================================================================
--- branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py	2008-01-09 20:55:47 UTC (rev 3810)
+++ branches/testing_cleanup/scipy/sandbox/timeseries/lib/tests/test_moving_funcs.py	2008-01-10 00:45:34 UTC (rev 3811)
@@ -13,20 +13,19 @@
 import numpy as N
 import numpy.core.numeric as numeric
 
-from scipy.testing import NumpyTest, TestCase
+from scipy.testing import *
 
-import maskedarray.testutils
-from maskedarray.testutils import *
+from scipy.sandbox.maskedarray.testutils import *
 
-import maskedarray as MA
-import maskedarray.core as coremodule
-from maskedarray.core import MaskedArray, masked
-from maskedarray import mstats
+import scipy.sandbox.maskedarray as MA
+import scipy.sandbox.maskedarray.core as coremodule
+from scipy.sandbox.maskedarray.core import MaskedArray, masked
+from scipy.sandbox.maskedarray import mstats
 
-import timeseries as TS
-from timeseries import time_series, thisday
+import scipy.sandbox.timeseries as TS
+from scipy.sandbox.timeseries import time_series, thisday
 
-from timeseries.lib import moving_funcs as MF
+from scipy.sandbox.timeseries.lib import moving_funcs as MF
 
 class TestCMovAverage(TestCase):
 



More information about the Scipy-svn mailing list