[Zope-dev] unit test policy questions

yuppie y.2010 at wcm-solutions.de
Thu Jul 29 07:26:07 EDT 2010


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?


Cheers,

	Yuppie


More information about the Zope-Dev mailing list