Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:33:53+00:00 2026-06-04T09:33:53+00:00

Another way to ask this: If I wrote doctests in reST, can I use

  • 0

Another way to ask this:
If I wrote doctests in reST, can I use it for Sphinx or other automatic documentation efforts?

Background: I don’t know how to use Sphinx and have not much experience with reST either, so I am wondering if I can use reST-written doctests somewhere else useful than with Sphinx?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:33:55+00:00Added an answer on June 4, 2026 at 9:33 am

    Why would I write doctests in restructured text?

    You don’t really write the tests “in restructured text”. The interactive examples are the test cases, and it does not matter what the surrounding markup looks like; it could be reST, or it could be something else like Markdown or LaTeX.

    reST has been adopted as the “official” markup language for Python documentation, but you are not obligated to use it.

    so why is the simple usage example for doctest.testfile() from the doctest documentation then given as a reST file?

    Doctest is a way to test code by checking the correctness of embedded interactive examples in documentation, so it makes sense that examples explaining the doctest module also include reST markup.

    You can run doctest on text files that contain only interactive input/output examples, and no other content. Those examples could be useful as lightweight unit tests, but on their own they would be less suitable as documentation.

    I am wondering if I can use reST-written doctests somewhere else useful than with Sphinx?

    Having testable code examples can be useful even if you don’t use Sphinx for your documentation.

    If you are looking for alternative documentation tools that understand reST, take a look at docutils (which Sphinx is based on, btw) and its front-end tools, such as rst2html.py.

    Another tool that might be of interest is rst2pdf.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Or to ask it another way, how OnEraseBkgnd() works? I'm building a custom control
Is there another way to do this Query ? $query = SELECT * FROM
I guess another way to phrase this would be Is there a class like
Is there another way to load MSHTML documents without use Application.ProcessMessages? To load a
Is there any other ways to make it another way than with closure and
I know this question has come up in some form, one way or another.
I can ask WebView.getWebSettings().getUserAgentString() to get the user agent, but this doesn't work all
Is there another way to connect to a MySQL database with what came included
Is there another way to run a regular JS function with parameters passed than
I'm looking for another way of doing the following: function call_any_function(func, parameters){ // func

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.