[Zope-dev] Test fixture concepts
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 29 08:40:59 EDT 2011
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.
Regards,
Stephan
--
Entrepreneur and Software Geek
Google me. "Zope Stephan Richter"
More information about the Zope-Dev
mailing list