Skip to content

Skiplist fails with duplicate items #102

@Sheila-nk

Description

@Sheila-nk

Currently, the DTConfig skiplist attribute effectively excludes test items from doctesting. However, it faces a limitation in SciPy where duplicate items are collected. These duplicates stem from the __all__ attribute in modules.
For instance, the bspline function from scipy.signal is collected more than once:

item: bspline
dtest: <DocTest scipy.signal._bsplines.bspline from /Users/sheilakahwai/Documents/Work/scipy/build-install/lib/python3.11/site-packages/scipy/signal/_bsplines.py:160 (12 examples)>
module: <module 'scipy.signal._bsplines' from '/Users/sheilakahwai/Documents/Work/scipy/build-install/lib/python3.11/site-packages/scipy/signal/_bsplines.py'>

item: bspline
dtest: <DocTest scipy.signal.bspline from /Users/sheilakahwai/Documents/Work/scipy/build-install/lib/python3.11/site-packages/scipy/signal/_bsplines.py:160 (12 examples)>
module: <module 'scipy.signal._bsplines' from '/Users/sheilakahwai/Documents/Work/scipy/build-install/lib/python3.11/site-packages/scipy/signal/_bsplines.py'>

However, the skiplist from refguide-check currently only skips one module, specifically: scipy.signal.bspline. To skip the duplicate, it's necessary to include it in the skiplist as well.

There are other instances where modules need to be skipped twice to avoid redundancy

dt_config.skiplist = [
    'scipy.special.sinc',
    'scipy.special._basic.sinc',  # comes from numpy
    'scipy.linalg.LinAlgError',
    'scipy.linalg._misc.LinAlgError',
    'scipy.signal.bspline',
    'scipy.signal._bsplines.bspline',
    'scipy.signal.cubic',
    'scipy.signal._bsplines.cubic',
    'scipy.signal.quadratic',
    'scipy.signal._bsplines.quadratic',
]

A temporary fix is to update the skiplist to accommodate such duplicates.

However, I think we need to tighten the collection a bit more to avoid duplicates and make it more seamless.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions