Skip to content

Commit

Permalink
MAINT skip tests that require large datadownload under travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrisel committed Jul 2, 2014
1 parent 68280fb commit ac45e5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions continuous_integration/test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ python -c "import numpy; print('numpy %s' % numpy.__version__)"
python -c "import scipy; print('scipy %s' % scipy.__version__)"
python setup.py build_ext --inplace

# Skip tests that require large downloads over the network to save bandwith
# usage as travis workers are stateless and therefore traditional local
# disk caching does not work.
export SKLEARN_SKIP_NETWORK_TESTS=1

if [[ "$COVERAGE" == "true" ]]; then
make test-coverage
else
Expand Down
5 changes: 5 additions & 0 deletions doc/tutorial/text_analytics/working_with_text_data_fixture.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from sklearn.utils.testing import check_skip_network


def setup_module():
check_skip_network()
9 changes: 9 additions & 0 deletions sklearn/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Arnaud Joly
# Denis Engemann
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
Expand Down Expand Up @@ -578,3 +579,11 @@ def clean_warning_registry():
for mod in sys.modules.copy().values():
if hasattr(mod, reg):
getattr(mod, reg).clear()


def check_skip_network():
if int(os.environ.get('SKLEARN_SKIP_NETWORK_TESTS', 0)):
raise SkipTest("Text tutorial requires large dataset download")


with_network = with_setup(check_skip_network)

0 comments on commit ac45e5d

Please sign in to comment.