summaryrefslogtreecommitdiff
path: root/nitime
diff options
context:
space:
mode:
authorarokem <arokem@berkeley.edu>2011-05-31 14:25:10 -0700
committerarokem <arokem@berkeley.edu>2011-05-31 14:25:10 -0700
commite8fb5fbe4c8828b9ed3f54f2649eeaf77c60b004 (patch)
treeea369deffdc29805569e8ae35cfa6045f16720c3 /nitime
parent66605e0685ca76431b7251372bf1e69a739953de (diff)
Working on slow tests and testlib
Diffstat (limited to 'nitime')
-rw-r--r--nitime/algorithms/tests/test_autoregressive.py2
-rw-r--r--nitime/algorithms/tests/test_spectral.py4
-rw-r--r--nitime/testlib.py12
-rw-r--r--nitime/tests/test_algorithms.py3
4 files changed, 16 insertions, 5 deletions
diff --git a/nitime/algorithms/tests/test_autoregressive.py b/nitime/algorithms/tests/test_autoregressive.py
index cd1be3a..02e6d8a 100644
--- a/nitime/algorithms/tests/test_autoregressive.py
+++ b/nitime/algorithms/tests/test_autoregressive.py
@@ -1,5 +1,6 @@
import numpy as np
import numpy.testing as npt
+import numpy.testing.decorators as dec
import nitime.algorithms as tsa
import nitime.utils as utils
@@ -79,6 +80,7 @@ def test_AR_LD():
npt.assert_almost_equal(avg_pwr, avg_pwr_est, decimal=0)
+@dec.slow
def test_MAR_est_LWR():
"""
diff --git a/nitime/algorithms/tests/test_spectral.py b/nitime/algorithms/tests/test_spectral.py
index 26ec509..742e366 100644
--- a/nitime/algorithms/tests/test_spectral.py
+++ b/nitime/algorithms/tests/test_spectral.py
@@ -6,6 +6,7 @@ Tests for the algorithms.spectral submodule
import numpy as np
import scipy
import numpy.testing as npt
+import numpy.testing.decorators as dec
import nose.tools as nt
import nitime
@@ -289,7 +290,8 @@ def test_mtm_cross_spectrum():
tsa.mtm_cross_spectrum,
tspectra,np.r_[tspectra, tspectra],
(w, w))
-
+
+@dec.slow
def test_multi_taper_psd_csd():
"""
diff --git a/nitime/testlib.py b/nitime/testlib.py
index ec5d631..db421a9 100644
--- a/nitime/testlib.py
+++ b/nitime/testlib.py
@@ -13,8 +13,11 @@ from nose.core import TestProgram
#-----------------------------------------------------------------------------
-def test(doctests=False):
- """Run the nitime test suite using nose.
+def test(doctests=False, fast=False):
+ """
+
+ Run the nitime test suite using nose.
+
"""
#Make sure that you only change the print options during the testing
#of nitime and don't affect the user session after that:
@@ -38,10 +41,11 @@ def test(doctests=False):
if doctests:
argv.append('--with-doctest')
-
+ if fast:
+ argv.append('-A "not slow"')
# Now nose can run
try:
- TestProgram(argv=argv, exit=False)
+ TestProgram(argv=argv)#, exit=False)
finally:
np.set_printoptions(**opt_dict)
diff --git a/nitime/tests/test_algorithms.py b/nitime/tests/test_algorithms.py
index f218969..23b0efa 100644
--- a/nitime/tests/test_algorithms.py
+++ b/nitime/tests/test_algorithms.py
@@ -2,6 +2,8 @@ import os
import numpy as np
import numpy.testing as npt
+import numpy.testing.decorators as dec
+
from scipy.signal import signaltools
import nitime
@@ -160,6 +162,7 @@ def test_psd_matlab():
npt.assert_almost_equal(fxx_mlab, fxx_matlab, decimal=5)
+@dec.slow
def test_long_dpss_win():
""" Test that very long dpss windows can be generated (using interpolation)"""