python setup.py test not working on Linux

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I tried adding the test command to my setuptools-enhanced build process. And I got "python setup.py test" to work on Windows, now when I'm on Linux it fails. I *think* that it was in both cases the latest version of setuptools. You should be able to verify it with these sources: svn co http://initd.org/svn/pysqlite/pysqlite/trunk/ pysqlite_trunk -r 202 Oh, you need SQLite version 3.2.2 or later to build this pysqlite project. This is the full output: gerhard@lara:~/src/svn/pysqlite/trunk$ python setup.py test running test running egg_info writing requirements to pysqlite.egg-info/requires.txt writing pysqlite.egg-info/PKG-INFO writing top-level names to pysqlite.egg-info/top_level.txt warning: manifest_maker: standard file not found: should have one of README, README.txt reading manifest template 'MANIFEST.in' writing manifest file 'pysqlite.egg-info/SOURCES.txt' running build_ext copying build/lib.linux-i686-2.4/pysqlite2/_sqlite.so -> lib Traceback (most recent call last): File "setup.py", line 151, in ? main() File "setup.py", line 137, in main classifiers = [ File "/usr/lib/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/test.py", line 59, in run self.run_tests() File "/usr/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/setuptools/command/test.py", line 73, in run_tests unittest.main(None, None, [unittest.__file__]+self.test_args) File "/usr/lib/python2.4/unittest.py", line 758, in __init__ self.parseArgs(argv) File "/usr/lib/python2.4/unittest.py", line 785, in parseArgs self.createTests() File "/usr/lib/python2.4/unittest.py", line 791, in createTests self.module) File "/usr/lib/python2.4/unittest.py", line 556, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python2.4/unittest.py", line 532, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'test' - -- Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD0A/HdIO4ozGCH14RAu1YAJkBQmM/QyuDvCbJEhQ71ggBsy3Y1QCghUee K2b9G/o1QIKqKLWUezRezQw= =RuvI -----END PGP SIGNATURE-----

At 11:16 PM 01/19/2006 +0100, Gerhard Häring wrote:
AttributeError: 'module' object has no attribute 'test'
This is probably an indication that the '.test' package was not importable for some reason. Try this: python setup.py develop python -c "import pysqlite2.test" and see what happens. The unittest package is rather notorious for not giving good error messages in the case of a failed import. It should really reraise the ImportError when it is unable to find an attribute.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Phillip J. Eby wrote:
At 11:16 PM 01/19/2006 +0100, Gerhard Häring wrote:
AttributeError: 'module' object has no attribute 'test'
This is probably an indication that the '.test' package was not importable for some reason.
Try this:
python setup.py develop python -c "import pysqlite2.test"
You were right! gerhard@lara:~/src/svn/pysqlite/trunk$ python -c "import pysqlite2.test" Traceback (most recent call last): File "<string>", line 1, in ? File "/home/gerhard/src/svn/pysqlite/trunk/pysqlite2/test/__init__.py", line 25, in ? from pysqlite2.test import dbapi, types, userfunctions, factory, transactions File "/home/gerhard/src/svn/pysqlite/trunk/pysqlite2/test/dbapi.py", line 26, in ? import pysqlite2.dbapi2 as sqlite File "lib/dbapi2.py", line 32, in ? from pysqlite2._sqlite import * ImportError: pysqlite2/_sqlite.so: undefined symbol: sqlite3_transfer_bindings
and see what happens. The unittest package is rather notorious for not giving good error messages in the case of a failed import. It should really reraise the ImportError when it is unable to find an attribute.
I forgot one step I usually always do when I get the above error message ... gerhard@lara:~/src/svn/pysqlite/trunk$ export LD_LIBRARY_PATH=/usr/local/lib/ gerhard@lara:~/src/svn/pysqlite/trunk$ python setup.py test -q running test running egg_info writing requirements to pysqlite.egg-info/requires.txt writing pysqlite.egg-info/PKG-INFO writing top-level names to pysqlite.egg-info/top_level.txt warning: manifest_maker: standard file not found: should have one of README, README.txt reading manifest template 'MANIFEST.in' writing manifest file 'pysqlite.egg-info/SOURCES.txt' running build_ext copying build/lib.linux-i686-2.4/pysqlite2/_sqlite.so -> lib ....................................................................................................................................................... - ---------------------------------------------------------------------- Ran 151 tests in 1.671s OK Now it works perfectly! Thanks. - -- Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD4DBQFD0DBGdIO4ozGCH14RAhwuAJ43ooK9MH7pTCiYVE1M9Vtbx0ZkywCYt597 S2lVHfrT3RpPtN0Uec44eQ== =muGK -----END PGP SIGNATURE-----
participants (2)
-
Gerhard Häring
-
Phillip J. Eby