[Zope3-Users] Add unittest

Marius Gedminas mgedmin at b4net.lt
Wed Apr 18 13:29:00 EDT 2007


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 tests:
> 
> florian at horus ~/Zope3 $ python 
> test.py -vpu --dir ../Desktop/zope/lib/python/ProxyCache/
...
> Running tests at level 1
> Traceback (most recent call last):
...
>   File "/home/florian/Zope3/src/zope/testing/testrunner.py", line 1236, in 
> import_name
>     __import__(name)
> ValueError: Empty module name

This smells like a bug in the testrunner.  Would it work if you removed
the trailing slash from the command line?

  test.py -vpu --dir ../Desktop/zope/lib/python/ProxyCache

Also, nowadays it is customary to pass package/module names to test.py instead of
directory names:

  test.py -vpu -s ProxyCache

Marius Gedminas
-- 
[...] the basic "your gun, your foot, your choice" memory model.
        -- jtv on lkml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20070418/910f4354/attachment.bin


More information about the Zope3-users mailing list