Skip to content

Commit

Permalink
Working on slow tests and testlib
Browse files Browse the repository at this point in the history
  • Loading branch information
arokem committed May 31, 2011
1 parent 66605e0 commit e8fb5fb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions nitime/algorithms/tests/test_autoregressive.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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():
"""
Expand Down
4 changes: 3 additions & 1 deletion nitime/algorithms/tests/test_spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
import scipy
import numpy.testing as npt
import numpy.testing.decorators as dec
import nose.tools as nt

import nitime
Expand Down Expand Up @@ -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():
"""
Expand Down
12 changes: 8 additions & 4 deletions nitime/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
#-----------------------------------------------------------------------------


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:
Expand All @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions nitime/tests/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import numpy as np
import numpy.testing as npt
import numpy.testing.decorators as dec

from scipy.signal import signaltools

import nitime
Expand Down Expand Up @@ -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)"""

Expand Down

0 comments on commit e8fb5fb

Please sign in to comment.