Re: [Zope3-Users] Add unittest

2007-04-18 Thread Marius Gedminas
On Tue, Apr 17, 2007 at 08:37:29PM +0200, Florian Lindner wrote: > I've tried to add a test to my package (I must confess it's my first test.) > > I've added an directory "tests", created an empty __init__.py in it and a > file > named test_proxycache.py which contains: .. > Now I try to run the

Re: [Zope3-Users] Add unittest

2007-04-18 Thread Benji York
Florian Lindner wrote: I've added an directory "tests", created an empty __init__.py in it and a file named test_proxycache.py which contains: import unittest I *highly* recommend doctests over most uses of unittest. One reasonable example of doctest usage is in zc.copy (http://svn.zope.or

Re: [Zope3-Users] Add unittest

2007-04-17 Thread Andrew Groom
Hi Florian, I've had some success with: import unittest class MyTestClass (unittest.TestCase): def test_something (self): ... def test_suite (): return unittest.TestLoader().loadTestsFromTestCase(MyTestClass) if __name__ == '__main__': unittest.main(defaultTest