#!/bin/bash

set -e

# called when DISTRIB=="conda"
source activate $VIRTUALENV
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
pushd $TEST_DIR
$CMD -m sklearn.utils.tests.test_estimator_checks
popd
