[TIP] Usefulness of new tool?
Andre Roberge
andre.roberge at gmail.com
Wed Jun 27 12:15:47 PDT 2007
Hi everyone,
(a question relevant to this list follows a long introduction)
Crunchy (http://code.google.com/p/crunchy) is a program that
transforms an otherwise normal html document into an interactive
session within a web browser. Currently (version 0.8.2) Crunchy
currently includes a "doctest" feature where a simulated interpreter
session is written and the person has to write some code that
satisfies the doctest in an editor (inside the page displayed by the
browser), click on a button so that Python calls the doctest module
applying the user code to the embedded "doctest". The idea here is
to use doctest as a way to teach Python concept (the user has to enter
some code).
Another alternative could be one where the user is not allowed to enter code:
Lately I have started writing doctest-based unit tests for Crunchy.
The approach I use is to write text files containing doctests and
comments. It occurred to me that I could convert these text files
into html document usable by Crunchy. I could modify Crunchy so that
it could, at the click of a button, execute all of the embedded
"doctest" code and display the result on the page.
At one level, I can see that this is largely a cosmetic feature, which
does not help as much with automating unit-based doctests as it does
with giving a user a nicer environment in which to review the tests
being performed.
Would such an "enhancement" to Crunchy be useful to people that do
doctest-based unit tests? Ask yourself: would I use this? I would
appreciate hearing about your opinion before I start trying to add a
feature that might turned out not to be used by anyone.
(since I don't do programming [other than working on Crunchy and
rur-ple purely as a hobby], I have very little use for tools to do
tests - so I don't need it, but would be willing to work on it if it
would be useful to others.)
Cheers,
André Roberge
More information about the testing-in-python
mailing list