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

Mock urlopen when starting doctests #13596

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MrMino
Copy link
Member

@MrMino MrMino commented Mar 18, 2022

Speculative fix for #13468 (speculative - because I haven't checked whether it does what it does ;)).

Closes #13468.

@MrMino
Copy link
Member Author

MrMino commented Mar 18, 2022

@Carreau is this acceptable?

@MrMino MrMino requested a review from Carreau March 18, 2022 13:00
@Carreau
Copy link
Member

Carreau commented Mar 25, 2022

I think that would be acceptable. I'm not fluent in mock, but I assume it's possible to make it return different values depending on the URL that is given to it to actually fake the requests ?

@MrMino
Copy link
Member Author

MrMino commented Mar 25, 2022

Yes, it's possible to patch it with a custom factory (see new_callable arg).

Note to self:

  • add autospec
  • fix failures

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

Successfully merging this pull request may close these issues.

doctest in IPython.core.display.Image requires network connection
2 participants