Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skiplist fails with duplicate items #102

Closed
Sheila-nk opened this issue Sep 21, 2023 · 2 comments
Closed

Skiplist fails with duplicate items #102

Sheila-nk opened this issue Sep 21, 2023 · 2 comments
Labels
bug Something isn't working pytest-plugin

Comments

@Sheila-nk
Copy link
Collaborator

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.

@ev-br
Copy link
Member

ev-br commented Sep 21, 2023

Agreed, let's press on with your temp workaround and revisit when we tighten up the loose ends.

@ev-br
Copy link
Member

ev-br commented Feb 20, 2024

Fixed in gh-107

@ev-br ev-br closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pytest-plugin
Projects
None yet
Development

No branches or pull requests

2 participants