Skip to content

Commit

Permalink
FIX: Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Sep 23, 2014
1 parent 20d338f commit 88888ba
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ install:
export FREESURFER_HOME=$(python -c 'import mne; print(mne.datasets.testing.data_path())');
fi;
else
export MNE_SKIP_TESTING_DATASET_TESTS=true
export MNE_SKIP_TESTING_DATASET_TESTS=true;
fi;
- MNE_DIR=$(python -c 'import mne;print(mne.__path__[0])')
# We run two versions: one out of the source directory (that makes
Expand All @@ -93,7 +93,13 @@ install:
fi;

script:
- nosetests --with-timer --timer-top-n 30 --verbosity=2;
# Ensure the "nodata" test does not access the internet
# (necessary to have MNE_SKIP_NETWORK_TESTS=1 above)
- if [ "${DEPS}" == "nodata" ]; then
sudo unshare -n -- nosetests --with-timer --timer-top-n 30 --verbosity=2;
else
nosetests --with-timer --timer-top-n 30 --verbosity=2;
fi;

after_success:
# Need to run from source dir to exectue "git" commands
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ test: in
rm -f .coverage
$(NOSETESTS) mne

test-no-network: in
sudo unshare -n -- sh -c 'MNE_SKIP_NETWORK_TESTS=1 nosetests mne'

test-no-testing-data: in
@MNE_SKIP_TESTING_DATASET_TESTS=true \
$(NOSETESTS) mne
Expand Down
4 changes: 2 additions & 2 deletions mne/beamformer/tests/test_dics.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_dics():
max_stc = stc.data[idx]
tmax = stc.times[np.argmax(max_stc)]

# Odd due to limited number of epochs
# Incorrect due to limited number of epochs
assert_true(0.04 < tmax < 0.05)
assert_true(10 < np.max(max_stc) < 13)

Expand Down Expand Up @@ -153,7 +153,7 @@ def test_dics():
max_stc = stc_avg[idx]
tmax = stc.times[np.argmax(max_stc)]

assert_true(0.045 < tmax < 0.06) # odd due to limited number of epochs
assert_true(0.045 < tmax < 0.06) # incorrect due to limited # of epochs
assert_true(12 < np.max(max_stc) < 18.5)


Expand Down
7 changes: 0 additions & 7 deletions mne/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,6 @@ def test_fetch_file():
"""Test file downloading
"""
tempdir = _TempDir()
# Skipping test if no internet connection available
try:
urllib.request.urlopen("http://github.com", timeout=2)
except:
from nose.plugins.skip import SkipTest
raise SkipTest('No internet connection, skipping download test.')

urls = ['http://www.google.com',
'ftp://surfer.nmr.mgh.harvard.edu/pub/data/bert.recon.md5sum.txt']
for url in urls:
Expand Down
1 change: 0 additions & 1 deletion mne/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import tempfile
import shutil
from shutil import rmtree
import atexit
from math import log, ceil
import json
import ftplib
Expand Down

0 comments on commit 88888ba

Please sign in to comment.