Erel Segal-Halevi
Erel Segal-Halevi

Reputation: 36745

Automatic testing of examples in documentation

In the end of the SageMath manual they explain why they chose to implement SageMath in Python. One of the items says: "Excellent support for documentation of functions and packages in the source code, including automatic extraction of documentation and automatic testing of all examples. The examples are automatically tested regularly and guaranteed to work as indicated."

This sounds neat, but I haven't found the way to do it. How can I automatically test all the examples that appear in the documentation to my functions?

Upvotes: 0

Views: 63

Answers (1)

kcrisman
kcrisman

Reputation: 4402

In principle, you can write your examples using this syntax. Then, you should be able to just do

sage -t path/to/myfile.sage

and apparently that works, given the comment thread!

Upvotes: 1

Related Questions