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

BUG: collect doctests from docstrings of data descriptors #180

Merged
merged 2 commits into from
Dec 17, 2024
Merged

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Dec 15, 2024

@ev-br ev-br added the bug Something isn't working label Dec 15, 2024
@ev-br
Copy link
Member Author

ev-br commented Dec 15, 2024

cc @mattip seems to be working as a workaround for numpy/numpy#28002, would you double-check?
(of course, it smokes several issues in previously-never-tested docstrings :-))

tests += super().find(
method, f'{name}.{name_}', module, globs, extraglobs
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to collect the descriptors, or could this be rewritten as

for name_, method in inspect.getmembers(obj):
    if inspect.isdatadescriptor(method):
        tests += super().find(
            method, f'{name}.{name_}', module, globs, extraglobs
        )

Not critical, whatever you think

Copy link
Contributor

@mattip mattip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one little nit.

@ev-br ev-br merged commit 855b4da into main Dec 17, 2024
16 checks passed
@ev-br
Copy link
Member Author

ev-br commented Dec 17, 2024

Thanks Matti! Adopted your spelling of the snippet, it's nicer indeed. And it's in.

@ev-br ev-br deleted the descriptors branch December 17, 2024 08:16
@mattip
Copy link
Contributor

mattip commented Dec 17, 2024

Will you be tagging a new release?

@ev-br
Copy link
Member Author

ev-br commented Dec 17, 2024

I'd like to have gh-179 in it, too.

@ev-br
Copy link
Member Author

ev-br commented Dec 17, 2024

OK, scipy-doctest==1.6 is on pypi, has both this and gh-179. Expect some breakage around numpy dtypes :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

numpy.dtype attributes are not recognized
2 participants