[PEAK] setuptools: Test works only after second invocation

Nikolaus Rath Nikolaus at rath.org
Thu Apr 29 11:47:05 EDT 2010


Hello,

Can someone explain to me what's going on here?

First invocation:

$ ./setup.py test
running test
Searching for unittest2
Reading http://pypi.python.org/simple/unittest2/
Best match: unittest2 0.4.0
Downloading http://pypi.python.org/packages/source/u/unittest2/unittest2-0.4.0.tar.gz#md5=bcf49f6045379d2cd2720e6a90194b01
Processing unittest2-0.4.0.tar.gz
Running unittest2-0.4.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-6UUZpM/unittest2-0.4.0/egg-dist-tmp-cPXA00
zip_safe flag not set; analyzing archive contents...
unittest2.loader: module references __file__

Installed /home/nikratio/bla/unittest2-0.4.0-py2.6.egg
running egg_info
creating src/s3ql.egg-info
writing src/s3ql.egg-info/PKG-INFO
writing top-level names to src/s3ql.egg-info/top_level.txt
writing dependency_links to src/s3ql.egg-info/dependency_links.txt
writing manifest file 'src/s3ql.egg-info/SOURCES.txt'
reading manifest file 'src/s3ql.egg-info/SOURCES.txt'
writing manifest file 'src/s3ql.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "./setup.py", line 12, in <module>
    test_suite='tests',
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/home/nikratio/.local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/test.py", line 121, in run
  File "/home/nikratio/.local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/test.py", line 101, in with_project_on_sys_path
  File "/home/nikratio/.local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/test.py", line 130, in run_tests
  File "/usr/lib/python2.6/unittest.py", line 816, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs
    self.createTests()
  File "/usr/lib/python2.6/unittest.py", line 849, in createTests
    self.module)
  File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.6/unittest.py", line 587, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/home/nikratio/.local/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/test.py", line 34, in loadTestsFromModule
  File "/usr/lib/python2.6/unittest.py", line 576, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/home/nikratio/bla/tests/t2_block_cache.py", line 1, in <module>
    import s3ql.block_cache
  File "/home/nikratio/bla/src/s3ql/block_cache.py", line 1, in <module>
    class CacheEntry(file):
TypeError: Error when calling the metaclass bases
    cannot create 'builtin_function_or_method' instances

Second invocation:    
$ ./setup.py test
running test
running egg_info
writing src/s3ql.egg-info/PKG-INFO
writing top-level names to src/s3ql.egg-info/top_level.txt
writing dependency_links to src/s3ql.egg-info/dependency_links.txt
reading manifest file 'src/s3ql.egg-info/SOURCES.txt'
writing manifest file 'src/s3ql.egg-info/SOURCES.txt'
running build_ext



Further calls to test work just fine -- until I delete the unittest2
folder in the current directory.

I have put a testcase on http://www.rath.org/trouble.tar.bz2. Note that
this only works if the unittest2 package is *not* installed.




Thanks,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C



More information about the PEAK mailing list