From b9b50dcf22e6317558b993373da959734327225f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 18 Nov 2013 12:27:44 +0100 Subject: [PATCH] Make sure stdlib io is not shadowed by skimage.io --- .travis.yml | 4 ++-- Makefile | 4 ++-- skimage/__init__.py | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91cc8141..3c627c85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,8 +59,8 @@ script: - "echo 'backend : Agg' > $HOME/.matplotlib/matplotlibrc" - "echo 'backend.qt4 : PyQt4' >> $HOME/.matplotlib/matplotlibrc" # Run all tests - - python -c "import skimage, sys; sys.exit(skimage.test_verbose())" - - python -c "import skimage, sys; sys.exit(skimage.doctest_verbose())" + - python -c "import skimage, sys, io; sys.exit(skimage.test_verbose())" + - python -c "import skimage, sys, io; sys.exit(skimage.doctest_verbose())" # Run all doc examples - export PYTHONPATH=$(pwd):$PYTHONPATH - for f in doc/examples/*.py; do $PYTHON "$f"; if [ $? -ne 0 ]; then exit 1; fi done diff --git a/Makefile b/Makefile index e8a85587..2ace534e 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,10 @@ clean: find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" | xargs rm -f test: - python -c "import skimage, sys; sys.exit(skimage.test_verbose())" + python -c "import skimage, sys, io; sys.exit(skimage.test_verbose())" doctest: - python -c "import skimage, sys; sys.exit(skimage.doctest_verbose())" + python -c "import skimage, sys, io; sys.exit(skimage.doctest_verbose())" coverage: nosetests skimage --with-coverage --cover-package=skimage diff --git a/skimage/__init__.py b/skimage/__init__.py index 49510c91..f5697c84 100644 --- a/skimage/__init__.py +++ b/skimage/__init__.py @@ -89,6 +89,7 @@ else: if doctest: args.extend(['--with-doctest', '--ignore-files=^\.', '--ignore-files=^setup\.py$$', '--ignore-files=test']) + # Make sure warnings do not break the doc tests with _warnings.catch_warnings(): _warnings.simplefilter("ignore") success = nose.run('skimage', argv=args)