diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f3a8d6b12b970..4498585e36ce5 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -65,23 +65,8 @@ fi if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then MSG='Doctests' ; echo $MSG - python -m pytest --doctest-modules \ - pandas/_config/ \ - pandas/_libs/ \ - pandas/_testing/ \ - pandas/api/ \ - pandas/arrays/ \ - pandas/compat/ \ - pandas/core \ - pandas/errors/ \ - pandas/io/ \ - pandas/plotting/ \ - pandas/tseries/ \ - pandas/util/ \ - pandas/_typing.py \ - pandas/_version.py \ - pandas/conftest.py \ - pandas/testing.py + # Ignore test_*.py files or else the unit tests will run + python -m pytest --doctest-modules --ignore-glob="**/test_*.py" pandas RET=$(($RET + $?)) ; echo $MSG "DONE" MSG='Cython Doctests' ; echo $MSG diff --git a/pandas/tests/arithmetic/conftest.py b/pandas/tests/arithmetic/conftest.py index 01b447aa855a3..49a6e442f890f 100644 --- a/pandas/tests/arithmetic/conftest.py +++ b/pandas/tests/arithmetic/conftest.py @@ -24,7 +24,9 @@ def switch_numexpr_min_elements(request): # ------------------------------------------------------------------ - +# doctest with +SKIP for one fixture fails during setup with +# 'DoctestItem' object has no attribute 'callspec' +# due to switch_numexpr_min_elements fixture @pytest.fixture(params=[1, np.array(1, dtype=np.int64)]) def one(request): """ @@ -37,11 +39,11 @@ def one(request): Examples -------- - >>> dti = pd.date_range('2016-01-01', periods=2, freq='H') - >>> dti + dti = pd.date_range('2016-01-01', periods=2, freq='H') + dti DatetimeIndex(['2016-01-01 00:00:00', '2016-01-01 01:00:00'], dtype='datetime64[ns]', freq='H') - >>> dti + one + dti + one DatetimeIndex(['2016-01-01 01:00:00', '2016-01-01 02:00:00'], dtype='datetime64[ns]', freq='H') """ @@ -61,6 +63,9 @@ def one(request): zeros.extend([0, 0.0, -0.0]) +# doctest with +SKIP for zero fixture fails during setup with +# 'DoctestItem' object has no attribute 'callspec' +# due to switch_numexpr_min_elements fixture @pytest.fixture(params=zeros) def zero(request): """ @@ -74,8 +79,8 @@ def zero(request): Examples -------- - >>> arr = RangeIndex(5) - >>> arr / zeros + arr = RangeIndex(5) + arr / zeros Float64Index([nan, inf, inf, inf, inf], dtype='float64') """ return request.param