[Zope-CMF] Re: Zope 3 events from workflow
Jens Vagelpohl
jens at dataflake.org
Wed Dec 27 11:25:35 EST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 27 Dec 2006, at 17:15, Martin Aspeli wrote:
>> From painful experience with the customer work right now, and
>> from the work on the CMF branch to convert tools to utilities I'll
>> add that they make debugging a lot harder (where can I step into
>> and through the test code with pdb as I normally do?) and the fact
>> that they don't just stop executing when an error is encountered
>> like a normal unit test does. They continue, usually spewing miles
>> and miles of text, and it's really annoying to scroll back screen
>> after screen after screen to find the real problem.
>
> I agree with the pdb problem. I tend to use them either to explain
> narratives about how code works, for functional tests with
> zope.testbrowser, and sometimes they just "feel" right for the
> thing to be tested, but I quickly came off using them for everything.
The testbrowser tests tend to be the worst when it comes to failures
early on and then spewing out never-ending messages because the
browser ist messed up at that point.
> To only see the first test failure (it'll continue to execute
> regardless, because you may have cleanup code that needs to run
> after...) in the output, you can do this, which I always do:
>
> import unittest
> import doctest
>
> from some.module import test_module
>
> optionflags = doctest.REPORT_ONLY_FIRST_FAILURE | doctest.ELLIPSIS
>
> def test_suite():
> suite = unittest.TestSuite()
> suite.addTest(doctest.DocTestSuite(test_module,
> optionflags=optionflags))
> return suite
That's good to know, thanks. I'll try that out when I hit the next
issue.
jens
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFkp6ARAx5nvEhZLIRAkscAKC5qW69vTV0if6zfpx4UXOhyH6MvwCgiIrV
KHG28IXVK/nQCC61ZozQ208=
=r7Tv
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list