Re: unit test policy questions

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On 29 July 2010 19:26, yuppie <[email protected]> wrote:
> Hi!
>
>
> Traditionally the last two lines of unit test files look like this:
>
> if __name__ == '__main__':
>     unittest.main(defaultTest='test_suite')
>
> That makes it easy to run the tests of a specific file. But it doesn't
> work with tests that require the zope testrunner. AFAICS something like
> this is needed instead:
>
> if __name__ == '__main__':
>     from zope.testing.testrunner import run
>     run(['-m', 'test_foo', '--test-path', '.'])
>
>
> Questions:
> ----------
>
> 1.) Is it still policy to add these lines?
>
> 2.) Is there a better solution for using zope testrunner than the one
> shown above?

I never do either. I install zc.recipe.testrunner in a buildout and
use bin/test, which picks up tests in modules automatically.

Martin
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.