you need to attach a test case that doenst have all the "generalorm" dependencies. also, i looked at this and i dont see why the ruledispatch stuff cant be factored out of the test as well since none of those functions seem to be called.
a one-file self-contained test case is best. since i dont see anything obviously wrong with the usage of SA here, i have a feeling that youll come across the problem when you continue to simplify the test case. On Jan 11, 2007, at 6:36 PM, Patrick Lewis wrote: > Hello, I have a test case in a project that I am working with that is > giving me fits. > > My problem is this. I have what I thing is a fairly straightforward > setUp method, and a test to make sure that setUp worked (test_setup). > > http://paste.turbogears.org/paste/828 > > When I run nosetests to do the tests, the test_setup test fails. > > ====================================================================== > ERROR: (tests.testsa.TestSqlAlchemy) "Make sure our setup is what we > think it is." > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/nose-0.9.0-py2.4.egg/nose/case.py", line 129, > in runTest > self.testCase(*self.arg) > File "/Users/plewis/Programming/TurboGears/GeneralORM_news/tests/ > testsa.py", line 62, in test_setup > IndexError: list index out of range > > -------------------- >> begin captured stdout << --------------------- > 2007-01-11 07:22:41,301 INFO sqlalchemy.engine.base.Engine.0x..30 > PRAGMA table_info(user_group) > 2007-01-11 07:22:41,301 INFO sqlalchemy.engine.base.Engine.0x..30 {} > 2007-01-11 07:22:41,301 INFO sqlalchemy.engine.base.Engine.0x..30 > PRAGMA table_info(tg_user) > 2007-01-11 07:22:41,302 INFO sqlalchemy.engine.base.Engine.0x..30 {} > 2007-01-11 07:22:41,302 INFO sqlalchemy.engine.base.Engine.0x..30 > PRAGMA table_info(tg_group) > 2007-01-11 07:22:41,302 INFO sqlalchemy.engine.base.Engine.0x..30 {} > 2007-01-11 07:22:41,303 INFO sqlalchemy.engine.base.Engine.0x..30 > PRAGMA table_info(tg_group) > 2007-01-11 07:22:41,303 INFO sqlalchemy.engine.base.Engine.0x..30 {} > 2007-01-11 07:22:41,303 INFO sqlalchemy.engine.base.Engine.0x..30 > PRAGMA table_info(tg_user) > 2007-01-11 07:22:41,303 INFO sqlalchemy.engine.base.Engine.0x..30 {} > 2007-01-11 07:22:41,303 INFO sqlalchemy.engine.base.Engine.0x..30 > PRAGMA table_info(user_group) > 2007-01-11 07:22:41,303 INFO sqlalchemy.engine.base.Engine.0x..30 {} > 2007-01-11 07:22:41,304 INFO sqlalchemy.engine.base.Engine.0x..30 > CREATE TABLE tg_group ( > group_id INTEGER NOT NULL, > group_name VARCHAR(16), > display_name VARCHAR(255), > created TIMESTAMP, > PRIMARY KEY (group_id), > UNIQUE (group_name) > ) > > > 2007-01-11 07:22:41,304 INFO sqlalchemy.engine.base.Engine.0x..30 None > 2007-01-11 07:22:41,304 INFO sqlalchemy.engine.base.Engine.0x..30 > COMMIT > 2007-01-11 07:22:41,305 INFO sqlalchemy.engine.base.Engine.0x..30 > CREATE TABLE tg_user ( > user_id INTEGER NOT NULL, > user_name VARCHAR(16), > email_address VARCHAR(255), > display_name VARCHAR(255), > password VARCHAR(40), > created TIMESTAMP, > PRIMARY KEY (user_id), > UNIQUE (user_name), > UNIQUE (email_address) > ) > > > 2007-01-11 07:22:41,305 INFO sqlalchemy.engine.base.Engine.0x..30 None > 2007-01-11 07:22:41,306 INFO sqlalchemy.engine.base.Engine.0x..30 > COMMIT > 2007-01-11 07:22:41,306 INFO sqlalchemy.engine.base.Engine.0x..30 > CREATE TABLE user_group ( > user_id INTEGER, > group_id INTEGER, > FOREIGN KEY(user_id) REFERENCES tg_user (user_id), > FOREIGN KEY(group_id) REFERENCES tg_group (group_id) > ) > > > 2007-01-11 07:22:41,306 INFO sqlalchemy.engine.base.Engine.0x..30 None > 2007-01-11 07:22:41,306 INFO sqlalchemy.engine.base.Engine.0x..30 > COMMIT > 2007-01-11 07:22:41,308 INFO sqlalchemy.engine.base.Engine.0x..30 > BEGIN > 2007-01-11 07:22:41,310 INFO sqlalchemy.engine.base.Engine.0x..30 > INSERT INTO tg_user (user_name, email_address, display_name, > password, created) VALUES (?, ?, ?, ?, ?) > 2007-01-11 07:22:41,310 INFO sqlalchemy.engine.base.Engine.0x..30 > ['bobvilla', '[EMAIL PROTECTED]', 'Bob Villa', 'toughasnails', > '2007-01-11 07:22:41.310027'] > 2007-01-11 07:22:41,311 INFO sqlalchemy.engine.base.Engine.0x..30 > INSERT INTO tg_user (user_name, email_address, display_name, > password, created) VALUES (?, ?, ?, ?, ?) > 2007-01-11 07:22:41,311 INFO sqlalchemy.engine.base.Engine.0x..30 > ['bobathome', '[EMAIL PROTECTED]', 'Bob Villa', 'hammertime', '2007-01-11 > 07:22:41.311389'] > 2007-01-11 07:22:41,312 INFO sqlalchemy.engine.base.Engine.0x..30 > COMMIT > UuUuUuU class User user_id=1 [EMAIL PROTECTED] > display_name=Bob Villa > 2007-01-11 07:22:41,314 INFO sqlalchemy.engine.base.Engine.0x..30 > SELECT tg_user.user_id AS tg_user_user_id, tg_user.created AS > tg_user_created, tg_user.email_address AS tg_user_email_address, > tg_user.display_name AS tg_user_display_name, tg_user.password AS > tg_user_password, tg_user.user_name AS tg_user_user_name > FROM tg_user > WHERE tg_user.user_name = ? ORDER BY tg_user.oid > 2007-01-11 07:22:41,314 INFO sqlalchemy.engine.base.Engine.0x..30 > ['bobvilla'] > 2007-01-11 07:22:41,316 INFO sqlalchemy.engine.base.Engine.0x..30 > SELECT tg_user.user_id AS tg_user_user_id, tg_user.created AS > tg_user_created, tg_user.email_address AS tg_user_email_address, > tg_user.display_name AS tg_user_display_name, tg_user.password AS > tg_user_password, tg_user.user_name AS tg_user_user_name > FROM tg_user ORDER BY tg_user.oid > 2007-01-11 07:22:41,316 INFO sqlalchemy.engine.base.Engine.0x..30 [] > [] > class User user_id=1 email_address=None display_name=None > class User user_id=2 [EMAIL PROTECTED] display_name=Bob Villa > > --------------------- >> end captured stdout << ---------------------- > > Above, it looks to me like that both User records got inserted and > committed (I see two INSERT statements). But, when I try to pull > them back out, one looks like the second one got saved with all of > its attributes, and the other one only has its id saved. > > When I run just the test_setup test, it works fine. > > I've tried to strip down the project as small as I can (basically the > test case and one stripped module file) into the attachment. It > requires RuleDispatch, but nothing else external. Any pointers would > be very much appreciated. > > Using SqlAlchemy 0.3.3 > > > > > > <GO_tiny.zip> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---