datetime.timedelta(seconds=180)
>>> valid_duration('your mom')
- datetime.timedelta(seconds=0)
+ datetime.timedelta(0)
"""
from datetime_utils import parse_duration
exit 2
fi
+
+FAILED_TESTS=""
if [ ${DOCTEST} -eq 1 ]; then
for doctest in $(grep -lR doctest ${ROOT}/*.py); do
BASE=$(basename ${doctest})
else
echo -e "${FAILED}"
FAILURES=$((FAILURES+1))
+ FAILED_TESTS="${FAILED_TESTS}, ${BASE}"
fi
done
fi
${test}
if [ $? -ne 0 ]; then
FAILURES=$((FAILURES+1))
+ FAILED_TESTS="${FAILED_TESTS}, ${BASE}"
fi
done
fi
${test}
if [ $? -ne 0 ]; then
FAILURES=$((FAILURES+1))
+ FAILED_TESTS="${FAILED_TESTS}, ${BASE}"
fi
done
fi
if [ ${FAILURES} -ne 0 ]; then
+ FAILED_TESTS=$(echo ${FAILED_TESTS} | sed 's/^, //g')
if [ ${FAILURES} -eq 1 ]; then
- echo -e "${RED}There was ${FAILURES} failure.${NC}"
+ echo -e "${RED}There was ${FAILURES} failure:"
else
- echo -e "${RED}There were ${FAILURES} failures.${NC}"
+ echo -e "${RED}There were ${FAILURES} failures:"
fi
+ echo "${FAILED_TESTS}"
+ echo -e "${NC}"
else
- echo -e "${GREEN}Everything looks good.${NC}"
+ echo -e "${BLACK}${ON_GREEN}Everything looks good.${NC}"
fi