10000 Tackle comments + some tweaks · scikit-learn/scikit-learn@eb02410 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb02410

Browse files
committed
Tackle comments + some tweaks
1 parent 5869fbf commit eb02410

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

build_tools/travis/test_script.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ if [[ "$SKIP_TESTS" != "true" ]]; then
6161
fi
6262

6363
if [[ "$CHECK_PYTEST_SOFT_DEPENDENCY" == "true" ]]; then
64-
conda remove -y py pytest || echo "pytest not found by conda"
65-
pip uninstall -y py pytest || echo "pytest not found by pip"
64+
conda remove -y py pytest || pip uninstall -y py pytest
6665
if [[ "$COVERAGE" == "true" ]]; then
67-
CMD="coverage run -a"
66+
# Need to append the coverage to the existing .coverage generated by
67+
# running the tests
68+
CMD="coverage run --append"
6869
else
6970
CMD="python"
7071
fi

sklearn/utils/tests/test_estimator_checks.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ def __init__(self):
256256
NonConformantEstimator)
257257

258258

259-
if __name__ == '__main__':
259+
def run_tests_without_pytest():
260+
"""Runs the tests in this file without using pytest.
261+
"""
260262
main_module = sys.modules['__main__']
261263
test_functions = [getattr(main_module, name) for name in dir(main_module)
262264
if name.startswith('test_')]
@@ -265,3 +267,9 @@ def __init__(self):
265267
suite.addTests(test_cases)
266268
runner = unittest.TextTestRunner()
267269
runner.run(suite)
270+
271+
272+
if __name__ == '__main__':
273+
# This module is run as a script to check that we have no dependency on
274+
# pytest for estimator checks.
275+
run_tests_without_pytest()

0 commit comments

Comments
 (0)
0