From a9bdde5f5fb9c61ad9304b93a668f6531ae2a2df Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Tue, 31 Mar 2020 13:40:08 +0300 Subject: [PATCH 1/2] CI: Add doctest check for done modules --- ci/code_checks.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 5401cc81785ab..bf653b64da046 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -279,8 +279,12 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then pytest -q --doctest-modules pandas/core/groupby/groupby.py -k"-cumcount -describe -pipe" RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Doctests datetimes.py' ; echo $MSG - pytest -q --doctest-modules pandas/core/tools/datetimes.py + MSG='Doctests tools' ; echo $MSG + pytest -q --doctest-modules pandas/core/tools/ + RET=$(($RET + $?)) ; echo $MSG "DONE" + + MSG='Doctests util' ; echo $MSG + pytest -q --doctest-modules pandas/core/util/ RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Doctests reshaping functions' ; echo $MSG @@ -323,6 +327,18 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then MSG='Doctests tseries' ; echo $MSG pytest -q --doctest-modules pandas/tseries/ RET=$(($RET + $?)) ; echo $MSG "DONE" + + MSG='Doctests sparse' ; echo $MSG + pytest -q --doctest-modules pandas/core/sparse/ + RET=$(($RET + $?)) ; echo $MSG "DONE" + + MSG='Doctests array_algos' ; echo $MSG + pytest -q --doctest-modules pandas/core/array_algos/ + RET=$(($RET + $?)) ; echo $MSG "DONE" + + MSG='Doctests computation' ; echo $MSG + pytest -q --doctest-modules pandas/core/computation/ + RET=$(($RET + $?)) ; echo $MSG "DONE" fi ### DOCSTRINGS ### From 702dc0fe0636bb51c91acc28a20cda41c0eadadb Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Tue, 31 Mar 2020 14:29:57 +0300 Subject: [PATCH 2/2] Removed empty checks When running `pytest --doctest-modules` and no tests are found the return status code is 5. Meaning that `$RET` is going to be larger than 0. --- ci/code_checks.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index bf653b64da046..be6c076952ca1 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -283,10 +283,6 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then pytest -q --doctest-modules pandas/core/tools/ RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Doctests util' ; echo $MSG - pytest -q --doctest-modules pandas/core/util/ - RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Doctests reshaping functions' ; echo $MSG pytest -q --doctest-modules pandas/core/reshape/ RET=$(($RET + $?)) ; echo $MSG "DONE" @@ -328,14 +324,6 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then pytest -q --doctest-modules pandas/tseries/ RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Doctests sparse' ; echo $MSG - pytest -q --doctest-modules pandas/core/sparse/ - RET=$(($RET + $?)) ; echo $MSG "DONE" - - MSG='Doctests array_algos' ; echo $MSG - pytest -q --doctest-modules pandas/core/array_algos/ - RET=$(($RET + $?)) ; echo $MSG "DONE" - MSG='Doctests computation' ; echo $MSG pytest -q --doctest-modules pandas/core/computation/ RET=$(($RET + $?)) ; echo $MSG "DONE"