0.5.1 fails on Mac OSX with fink
Unittest failed when trying to update sqlalchemy for fink to 0.5.1. I (kurt) am the maintainer of the sqlalchemy package for fink on mac osx.
On Mac OSX 10.5.6, the unittests fail for both python 2.5 and pythn 2.6 with sqlite3:
i sqlite3-shlibs 3.4.2-1004 Embedded SQL database (shared libraries)
email kurt at ccom dot unh.edu for the complete test failure.
-kurt
Doctest: sqlalchemy.ext.orderinglist ... ok Doctest: sqlalchemy.ext.sqlsoup ... ok testattach (zblog.tests.SavePostTest) ... ok testoptimisticorphans (zblog.tests.SavePostTest) ... ok
====================================================================== ERROR: test_override_existing_fk (engine.reflection.ReflectionTest)
Traceback (most recent call last): File "/sw/src/fink.build/sqlalchemy-py26-0.5.1-1/SQLAlchemy-0.5.1/test/testlib/testing.py", line 223, in maybe return fn(args, *kw) File "/sw/src/fink.build/sqlalchemy-py26-0.5.1-1/SQLAlchemy-0.5.1/test/engine/reflection.py", line 315, in test_override_existing_fk assert s.c.user_id File "/sw/lib/python2.6/site-packages/sqlalchemy/util.py", line 1358, in get obj.dictself.name = result = self.fget(obj) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/expression.py", line 1891, in _columns self._export_columns() File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/expression.py", line 1921, in _export_columns self._populate_column_collection() File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/expression.py", line 3455, in _populate_column_collection c._make_proxy(self, name=self.use_labels and c._label or None) File "/sw/lib/python2.6/site-packages/sqlalchemy/schema.py", line 743, in _make_proxy for f in fk File "/sw/lib/python2.6/site-packages/sqlalchemy/schema.py", line 54, in _init_items item._set_parent(self) File "/sw/lib/python2.6/site-packages/sqlalchemy/schema.py", line 929, in _set_parent self.parent.table.foreign_keys.remove(fk) KeyError: ForeignKey(u'users.id')
====================================================================== ERROR: test_percent_chars (sql.select.SelectTest)
Traceback (most recent call last): File "/sw/src/fink.build/sqlalchemy-py26-0.5.1-1/SQLAlchemy-0.5.1/test/sql/select.py", line 846, in test_percent_chars SELECT "table%name"."percent%" AS "table%name_percent%", \ File "/sw/src/fink.build/sqlalchemy-py26-0.5.1-1/SQLAlchemy-0.5.1/test/testlib/testing.py", line 623, in assert_compile c = clause.compile(column_keys=keys, dialect=dialect) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/expression.py", line 1200, in compile compiler.compile() File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 196, in compile self.string = self.process(self.statement) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 199, in process return obj.compiler_dispatch(self, kwargs) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 50, in _compiler_dispatch return getter(visitor)(self, kw) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 503, in visit_select for co in select.inner_columns File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 199, in process return obj._compiler_dispatch(self, kwargs) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 50, in _compiler_dispatch return getter(visitor)(self, kw) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 255, in visit_label self.operator_string(operators.as) + " " + \ File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 199, in process return obj._compiler_dispatch(self, kwargs) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 50, in _compiler_dispatch return getter(visitor)(self, kw) File "/sw/lib/python2.6/site-packages/sqlalchemy/sql/compiler.py", line 280, in visit_column return schema_prefix + self.preparer.quote(column.table.name % self.anon_map, column.table.quote) + "." + name ValueError: unsupported format character 'n' (0x6e) at index 6
... and many more errors.
Comments (6)
-
repo owner -
Account Deleted That was the problem.... definitely getting an older sqlalchemy install during the test. This InfoTest for fix works. Please close this bug report.
As a thought, you might consider making the test harness force getting sqlalchemy from ../lib
Thanks! -kurt
InfoTest: << #TestConflicts: sqlalchemy-py%type_pkg[python](python) # Not needed with PYTHONPATH TestScript: << #!/bin/bash -ev export PYTHONPATH=$PWD/lib pushd test %p/bin/python%type_raw[python](python) alltests.py || exit 2 popd << <<
-
repo owner - changed status to wontfix
Replying to guest:
As a thought, you might consider making the test harness force getting sqlalchemy from ../lib
we do : source:sqlalchemy/trunk/README.unittests@HEAD#L24 :)
-
Account Deleted Ah, I see now. Calling test/alltests.py works as expected. Thanks! I amend my suggestion to ask for a test_suite entry in setup.py (e.g. like geojson). That way python setup.py test will work as expected.
-
repo owner i looked at the "test_suite" entry and this doesn't appear to be an option for us as we base our tests on a local copy of "unittest.py". our reliance on that is an issue I'd like to solve someday but it's not clear to me how to accomplish that at the moment.
-
Account Deleted ok. Thanks for the response.
-kurt
- Log in to comment
I believe your installation and/or method of running the tests is not correct such that a previous version of SQLAlchemy is being invoked. The tests you mention are both new tests as of 0.5.1 which will fail in 0.5.0. I can see from your stack trace that you're running the tests out of a fink.build directory but the SQLAlchemy library files are being invoked from your Python site-packages directory:
Additionally, the stack trace for test_override_existing_fk illustrates specifically the flow which no longer takes place in 0.5.1, so that is definitely a previous version of the library being invoked.
I am on OSX 10.5.6 as well and all tests pass with a fresh tar.gz file, using python 2.5/sqlite 3.3.14 as well as python 2.6/sqlite 3.6.5.