[Grok-dev] Re: RFC: Grokking tests

Darryl Cousins darryl at darrylcousins.net.nz
Fri Mar 30 19:58:50 EDT 2007


Hi,

Please excuse my lack of comment and I haven't even looked at the code.

In my work last year with Zope3 I often had problems setting up doctests
- registering all needed adapters etc, especially when needing to get a
placeful structure. I haven't attempted this yet with my current
doctests in grok packags.

All that might need to be done to get a doctest started:

	>>> import grok
	>>> grok.placeless_setup()
	>>> grok.grok('tfws.samplesite')
	>>> site = SampleSite()
	...  further test statements
	
or if I needed a root object

	>>> import grok
	>>> root = grok.placeful_setup()
	>>> grok.grok('tfws.samplesite')
	>>> root['site'] = SampleSite()
	... further test statements

And tests.py would need no more than:

def test_suite():
    return unittest.TestSuite((
        doctest.DocFileSuite('README.txt',
optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
        ))

My wish list. ;-)

Best regards,
Darryl




More information about the Grok-dev mailing list