[Grok-dev] manuel plugin for Martian's FakeModule?

Martijn Faassen faassen at startifact.com
Wed Oct 7 16:09:41 EDT 2009


Hi there,

I'm just throwing this idea out there in the hopes someone will want to 
hack on it.

With Martian we've introduced a FakeModule facility to make it easier to 
test whole python modules from within doctests. See the Martian docs for 
examples:

http://pypi.python.org/pypi/martian/0.12

This still looks fairly ugly, all this stuff:

   >>> blahblah
   ... blah
   ... blahblah

Manuel is a library that makes it easier to write testable documentation 
(and documented tests):

http://packages.python.org/manuel/

It includes a number of plug-ins to support all sorts of nice features 
that you don't get in plain doctests.

It looks to me like the FakeModule bit could make a very nice Manuel 
extension.

The FakeModule support + manuel integration could be in a separate 
library, but since this seems to be of general utility better yet it 
seems to me would be integrating this into Manuel proper.

I hope an interested hacker wants to work on this!

Now some other ideas that shouldn't discourage an interested hacker from 
taking up the previously sketched out project - others could do what's 
followed, step by step:

Once this is done, the next step would be for people to adjust the 
Martian doctests to use this facility. They could look a lot prettier 
and more readable.

Finally, a step where we can hopefully recruit a whole bunch of 
volunteers would be to use this technology for all the tests we have in 
grokcore.* and grok. Right now we use the approach where the doctest is 
on the top of the real module, with some fixtures on the side. It'd be 
prettier if we could just make a bunch of documents instead that include 
these modules. I imagine with some test-isolation support (we probably 
need to extend the Manuel stuff to roll back configuration too), we 
could have a whole bunch of related tests in a single document, with 
more explanatory text.

Regards,

Martijn



More information about the Grok-dev mailing list