File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,11 @@ if [[ "$SKIP_TESTS" != "true" ]]; then
61
61
fi
62
62
63
63
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
66
65
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"
68
69
else
69
70
CMD=" python"
70
71
fi
Original file line number Diff line number Diff line change @@ -256,7 +256,9 @@ def __init__(self):
256
256
NonConformantEstimator )
257
257
258
258
259
- if __name__ == '__main__' :
259
+ def run_tests_without_pytest ():
260
+ """Runs the tests in this file without using pytest.
261
+ """
260
262
main_module = sys .modules ['__main__' ]
261
263
test_functions = [getattr (main_module , name ) for name in dir (main_module )
262
264
if name .startswith ('test_' )]
@@ -265,3 +267,9 @@ def __init__(self):
265
267
suite .addTests (test_cases )
266
268
runner = unittest .TextTestRunner ()
267
269
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 ()
You can’t perform that action at this time.
0 commit comments