[Zope-dev] Test fixture concepts

Wichert Akkerman wichert at wiggy.net
Tue Mar 29 08:43:35 EDT 2011


On 3/29/11 14:40 , Stephan Richter wrote:
> On Tuesday, March 29, 2011, Jim Fulton wrote:
>>> so I may forgo them.
>>
>> Which is a mistake. You should create separate tests.  I typically put
>> large tests, dealing with main use cases where there is a definite
>> flow of activity in '.test' files.  I do these in separate files
>> because they're easier to write that way.  I use a '.test' suffix to
>> avoid the pretense that these are documentation.  I put edge-case
>> tests in small docstrings in testing modules.  I'm not really
>> religious about using doctests for this, but I find small edge-case
>> doctests easier to read than traditional unit tests. It's possible
>> that I'd like py.test tests as much.
>
> Yeah, Marius led me recently to that path too. Write a narrative in text files
> and use doc strings of functions to do edge cases (or when you don't have time
> for the narrative). I am getting used to it. I still much prefer the sort of
> output comparison that doctests/manuel gives me over the assertion language
> that unittest.TestCase requires.

FWIW unittest2 has much nicer output if you use the new assert methods.

Wichert.


More information about the Zope-Dev mailing list