Skip to content

Commit

Permalink
MNT Refactors doc test into seperate script (#12248)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjpfan authored and jnothman committed Oct 15, 2018
1 parent ad5d1d9 commit 42049b7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Expand Up @@ -62,7 +62,10 @@ matrix:
if: type = cron OR commit_message =~ /\[scipy-dev\]/

install: source build_tools/travis/install.sh
script: bash build_tools/travis/test_script.sh
script:
- bash build_tools/travis/test_script.sh
- bash build_tools/travis/test_docs.sh
- bash build_tools/travis/test_pytest_soft_dependency.sh
after_success: source build_tools/travis/after_success.sh
notifications:
webhooks:
Expand Down
8 changes: 8 additions & 0 deletions build_tools/travis/test_docs.sh
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

if [[ "$SKIP_TESTS" != "true" ]]; then
set -x
make test-doc
fi
18 changes: 18 additions & 0 deletions build_tools/travis/test_pytest_soft_dependency.sh
@@ -0,0 +1,18 @@
##!/bin/bash

set -e

if [[ "$CHECK_PYTEST_SOFT_DEPENDENCY" == "true" ]]; then
conda remove -y py pytest || pip uninstall -y py pytest
if [[ "$COVERAGE" == "true" ]]; then
# Need to append the coverage to the existing .coverage generated by
# running the tests
CMD="coverage run --append"
else
CMD="python"
fi
# .coverage from running the tests is in TEST_DIR
cd $TEST_DIR
$CMD -m sklearn.utils.tests.test_estimator_checks
cd $OLDPWD
fi
20 changes: 0 additions & 20 deletions build_tools/travis/test_script.sh
Expand Up @@ -46,11 +46,6 @@ run_tests() {
set -x # print executed commands to the terminal

$TEST_CMD sklearn

# Going back to git checkout folder needed to test documentation
cd $OLDPWD

make test-doc
}

if [[ "$RUN_FLAKE8" == "true" ]]; then
Expand All @@ -60,18 +55,3 @@ fi
if [[ "$SKIP_TESTS" != "true" ]]; then
run_tests
fi

if [[ "$CHECK_PYTEST_SOFT_DEPENDENCY" == "true" ]]; then
conda remove -y py pytest || pip uninstall -y py pytest
if [[ "$COVERAGE" == "true" ]]; then
# Need to append the coverage to the existing .coverage generated by
# running the tests
CMD="coverage run --append"
else
CMD="python"
fi
# .coverage from running the tests is in TEST_DIR
cd $TEST_DIR
$CMD -m sklearn.utils.tests.test_estimator_checks
cd $OLDPWD
fi

0 comments on commit 42049b7

Please sign in to comment.