-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
No way to run no_run
doctests
#82715
Comments
Personally I think the current behavior of the attributes is bad, or at least confusingly named - |
Posting this here as well as #87586, since it's highly relevant to the OP here as well: I think My ideal state of the world:
Given current usage of
Footnotes |
Note that the cargo update on nightly to clap4 has changed behavior such that rustdoc is limited in what it can do here in that it essentially creates a single Fun fact falling out of that: you can use Based on this understanding, I don't think there is a way in the current architecture to have a documentation test which is compiled and have a flag to run the test. |
There's some flag to compile only and persist the doctest afterwards, which lets you run the doc test manually yourself. But I'm not sure that rustdoc actually emits the name of the generated file which makes it kind of useless. |
The Rustdoc book suggests that
no_run
However, it follows from this that in some cases you do want to run doctests marked as
no_run
, such as if the test environment does have network access. This is possible with regular tests marked#[ignore]
by passing-- --ignored
tocargo test
, but the same does not work with documentation tests. Either an argument to runno_run
doctests should be added, or the rustdoc book should be updated with a more appropriate use-case forno_run
. The latter is probably a better solution for now, given that adding such a flag would likely be difficult.The text was updated successfully, but these errors were encountered: