8000 MNT Refactors doc test into seperate script (#12248) · scikit-learn/scikit-learn@3804ccd · GitHub
[go: up one dir, main page]

Skip to content

Commit 3804ccd

Browse files
thomasjpfanjnothman
authored andcommitted
MNT Refactors doc test into seperate script (#12248)
1 parent f4e7d2b commit 3804ccd

File tree

4 files changed

+30
-21
lines changed

4 files changed

+30
-21
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ matrix:
6262
if: type = cron OR commit_message =~ /\[scipy-dev\]/
6363

6464
install: source build_tools/travis/install.sh
65-
script: bash build_tools/travis/test_script.sh
65+
script:
66+
- bash build_tools/travis/test_script.sh
67+
- bash build_tools/travis/test_docs.sh
68+
- bash build_tools/travis/test_pytest_soft_dependency.sh
6669
after_success: source build_tools/travis/after_success.sh
6770
notifications:
6871
webhooks:

build_tools/travis/test_docs.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [[ "$SKIP_TESTS" != "true" ]]; then
6+
set -x
7+
make test-doc
8+
fi
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
##!/bin/bash
2+
3+
set -e
4+
5+
if [[ "$CHECK_PYTEST_SOFT_DEPENDENCY" == "true" ]]; then
6+
conda remove -y py pytest || pip uninstall -y py pytest
7+
if [[ "$COVERAGE" == "true" ]]; then
8+
# Need to append the coverage to the existing .coverage generated by
9+
# running the tests
10+
CMD="coverage run --append"
11+
else
12+
CMD="python"
13+
fi
14+
# .coverage from running the tests is in TEST_DIR
15+
cd $TEST_DIR
16+
$CMD -m sklearn.utils.tests.test_estimator_checks
17+
cd $OLDPWD
18+
fi

build_tools/travis/test_script.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ run_tests() {
4646
set -x # print executed commands to the terminal
4747

4848
$TEST_CMD sklearn
49-
50-
# Going back to git checkout folder needed to test documentation
51-
cd $OLDPWD
52-
53-
make test-doc
5449
}
5550

5651
if [[ "$RUN_FLAKE8" == "true" ]]; then
@@ -60,18 +55,3 @@ fi
6055
if [[ "$SKIP_TESTS" != "true" ]]; then
6156
run_tests
6257
fi
63-
64-
if [[ "$CHECK_PYTEST_SOFT_DEPENDENCY" == "true" ]]; then
65-
conda remove -y py pytest || pip uninstall -y py pytest
66-
if [[ "$COVERAGE" == "true" ]]; then
67-
# Need to append the coverage to the existing .coverage generated by
68-
# running the tests
69-
CMD="coverage run --append"
70-
else
71-
CMD="python"
72-
fi
73-
# .coverage from running the tests is in TEST_DIR
74-
cd $TEST_DIR
75-
$CMD -m sklearn.utils.tests.test_estimator_checks
76-
cd $OLDPWD
77-
fi

0 commit comments

Comments
 (0)
0