I do definitely support the idea of doctests for illustrative purposes. However, as already mentioned, relying on them for the whole testing framework is bad IMHO. Here are several reasons:
  - random seeds are always the same
  - impossible to have complicated test code
- impossible to tune the tests to make it more intensive (let say I want to run the tests for 1000 inputs rather than 10)
  - TESTS part are often unreadable
  - `TestSuite(my_object).run()` is not illustrative

As underlined by Jeroen, our 100% coverage policy made some people do copy-paste. As a consequence, some quite long doctests get executed twice and makes `sage -tp --all` much slower.

I would suggest:

1) Change the guildelines to become "have 100% doctest coverage for *public* methods/functions". We could even make it stronger by adding "Test and document each function with each possible range of options. Each code path (including errors) must be tested".

2) Introduce an alternative way of testing Sage code in the flavour of unit tests (eg with python files in SAGE_ROOT/tests/) and move all the content of the TESTS blocks into this framework.

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to