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

Implement handling of Expected exceptions in Doctests. #274

Open
Carreau opened this issue Sep 7, 2023 · 6 comments
Open

Implement handling of Expected exceptions in Doctests. #274

Carreau opened this issue Sep 7, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@Carreau
Copy link
Member

Carreau commented Sep 7, 2023

Currently we just exclude docstrings examples which raise exceptions unconditionally.

We should check that the error match what is in the docstring, like the classic doctes.

@asmeurer
Copy link
Collaborator

asmeurer commented Sep 8, 2023

If papyri is going to execute doctest examples it should just use the doctest module directly.

@Carreau
Copy link
Member Author

Carreau commented Sep 12, 2023

The problem is that we execute also for Jedi to properly infer which objects are in example.
It's not present right now, but we used to have cross links for every token in code example.
We also use that to capture the created images by matplotlib, and display them

I was unable to do it with doctest.

@asmeurer
Copy link
Collaborator

In my experience doctest is pretty extensible. I think it might be possible to hook into it to handle these things.

@melissawm
Copy link
Collaborator

@melissawm melissawm added the enhancement New feature or request label Oct 26, 2023
@asmeurer
Copy link
Collaborator

Really we need to make the whole doctester pluggable, so that different libraries can use different doctesting tools. Picking just one thing as a default is in appropriate for all libraries, although if there has to be a default, it should be the basic doctest.

@Carreau
Copy link
Member Author

Carreau commented Oct 27, 2023

I agree that we should make it pluggable, like many other things, but this might come at a later date, once we have a better understanding of what the needs are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants