-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: file IO in doctest examples #20302
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
Comments
@TomAugspurger what do you mean with "convert this to a regular code-block" -> I suppose not using I would prefer not doing Maybe we could somehow use a pytest fixture for temporary directory, but of course, that is also not transparent to the user .. |
Yep. That "avoids" the problem by not actually running the doctest :) I think the best is to just |
Yes, that is probably the easiest |
yep agreed using the remove is pretty idiomatic (and its not in that many places anyhow) |
The approach in #44711 was to skip the lines that will actually write a file and validate that docstrings don't leave leftover files. This was done due to a flaky segfault in the CI in during docstring validation which was suspected to be because of leftover files: #44590 Since this has a consistent behavior now, closing, but happy to reopen if there are other considerations. |
In several docstrings we write some data to a temporary file to illustrate reading / writing functionality.
However, this leaves behind those files when running the docstest, which is not ideal.
@TomAugspurger from #20208 (review)
The text was updated successfully, but these errors were encountered: