Skip to content

Commit ac45e5d

Browse files
committed
MAINT skip tests that require large datadownload under travis
1 parent 68280fb commit ac45e5d

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

continuous_integration/test_script.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ python -c "import numpy; print('numpy %s' % numpy.__version__)"
1111
python -c "import scipy; print('scipy %s' % scipy.__version__)"
1212
python setup.py build_ext --inplace
1313

14+
# Skip tests that require large downloads over the network to save bandwith
15+
# usage as travis workers are stateless and therefore traditional local
16+
# disk caching does not work.
17+
export SKLEARN_SKIP_NETWORK_TESTS=1
18+
1419
if [[ "$COVERAGE" == "true" ]]; then
1520
make test-coverage
1621
else
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from sklearn.utils.testing import check_skip_network
2+
3+
4+
def setup_module():
5+
check_skip_network()

sklearn/utils/testing.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Arnaud Joly
99
# Denis Engemann
1010
# License: BSD 3 clause
11+
import os
1112
import inspect
1213
import pkgutil
1314
import warnings
@@ -578,3 +579,11 @@ def clean_warning_registry():
578579
for mod in sys.modules.copy().values():
579580
if hasattr(mod, reg):
580581
getattr(mod, reg).clear()
582+
583+
584+
def check_skip_network():
585+
if int(os.environ.get('SKLEARN_SKIP_NETWORK_TESTS', 0)):
586+
raise SkipTest("Text tutorial requires large dataset download")
587+
588+
589+
with_network = with_setup(check_skip_network)

0 commit comments

Comments
 (0)