what version of postgres are you running ?

Those two reflection tests are doing something tricky; they create  
some tables, then under a new MetaData reflect them from the pg  
system catalog.  then they drop the tables, and try to re-create them  
using the reflected table information.  in reality, youd never need  
to do this...but its a very punishing test for CREATE/DROP/reflection  
all saying the same thing (which of course, they never really do  
completely).

your tests are failing at the very end of this process, and it seems  
like because its tripping up on the sequences specified in the  
DEFAULT for the column.  those sequences were probably dropped when  
the tables were dropped (since they get generated as a result of  
SERIAL), though im not sure why it would care, since they are  
function arguments, and also if the fact that its using the word  
"relation" in the error message is significant.  on mine ive never  
had that problem.

if it is indeed checking for the sequence existing, im not sure what  
the best way to fix that is, except for just changing the approach of  
the unit test altogether.

> sql/testtypes.py:
>   AdaptTest.testadapt() depends on multiple databases (sqlite,  
> postgres, mysql)
>
> sql/select.py
>   SelectTest.testcast() depends on multiple databases
>   SelectTest.testtextbinds() depends on multiple databases
>   SelectTest.testtextbinds() depends on multiple databases

these tests are using the dialects for the corresponding databases,  
but should not require the actual DBAPI modules to be present (each  
module in sqlalchemy/databases/ should have its DBAPI imports in a  
try/except).  do they break on your install ? (as i am on the laptop  
with everything installed....)

On Aug 21, 2006, at 2:08 PM, dmiller wrote:

>
> On Aug 21, 2006, at 12:43 PM, Michael Bayer wrote:
>
>> all of the offending tests, if you add a decorator above them  
>> which says:
>>
>>      @testbase.supported('sqlite')
>>
>> it should cause those tests only to be run with --db sqlite or  
>> default, not --db postgres.  can you give that a try ?
>
> Sure, a patch is attached. With the patch I can at least run all  
> the tests. However, your advice didn't seem to apply to some of the  
> tests:
>
> engine/proxy_engine.py:
>   ThreadProxyTest.tearDownAll() fails. Suggestion: move teardown  
> logic into test_multi_thread()
>
> sql/testtypes.py:
>   AdaptTest.testadapt() depends on multiple databases (sqlite,  
> postgres, mysql)
>
> sql/select.py
>   SelectTest.testcast() depends on multiple databases
>   SelectTest.testtextbinds() depends on multiple databases
>   SelectTest.testtextbinds() depends on multiple databases
>
>
> There are two tests in the engine suite that I'm not sure why they  
> are failing. They do not appear to be failing due to sqlite  
> dependencies:
>
> ======================================================================
> ERROR: testbasic (engine.reflection.ReflectionTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/test/ 
> engine/reflection.py", line 80, in testbasic
>     users.create()
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/schema.py", line 275, in create
>     self.engine.create(self, checkfirst=checkfirst)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 401, in create
>     self._run_visitor(self.dialect.schemagenerator, entity,  
> connection=connection, **kwargs)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 425, in _run_visitor
>     element.accept_schema_visitor(visitorcallable(self, conn.proxy,  
> connection=conn, **kwargs))
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/schema.py", line 228, in accept_schema_visitor
>     return visitor.visit_table(self)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/ansisql.py", line 634, in visit_table
>     self.execute()
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 687, in execute
>     return self.proxy(self.buffer.getvalue(), None)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 356, in proxy
>     return self._execute_raw(statement, parameters)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 321, in _execute_raw
>     self._execute(cursor, statement, parameters, context=context)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 340, in _execute
>     raise exceptions.SQLError(statement, parameters, e)
> SQLError: (ProgrammingError) relation "engine_users_user_id_seq"  
> does not exist
> "\nCREATE TABLE engine_users (\n\tuser_id INTEGER DEFAULT nextval 
> ('engine_users_user_id_seq'::regclass) NOT NULL, \n\tuser_name  
> VARCHAR(20) NOT NULL, \n\ttest1 CHAR(5) NOT NULL, \n\ttest2 FLOAT 
> (10) NOT NULL, \n\ttest3 TEXT, \n\ttest4 NUMERIC(10, 2) NOT NULL, \n 
> \ttest5 TIMESTAMP, \n\tparent_user_id INTEGER, \n\ttest6 TIMESTAMP  
> NOT NULL, \n\ttest7 TEXT, \n\ttest8 BYTEA, \n\ttest_passivedefault  
> DATE DEFAULT ('now'::text)::date, \n\ttest_passivedefault2 INTEGER  
> DEFAULT 5, \n\ttest_passivedefault3 TEXT DEFAULT 'im a  
> default'::text, \n\ttest9 BYTEA, \n\tPRIMARY KEY (user_id), \n\t  
> CONSTRAINT engine_users_parent_user_id_fkey FOREIGN KEY 
> (parent_user_id) REFERENCES engine_users (user_id)\n)\n\n" {}
>
> ======================================================================
> ERROR: testmultipk (engine.reflection.ReflectionTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/test/ 
> engine/reflection.py", line 164, in testmultipk
>     table.create()
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/schema.py", line 275, in create
>     self.engine.create(self, checkfirst=checkfirst)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 401, in create
>     self._run_visitor(self.dialect.schemagenerator, entity,  
> connection=connection, **kwargs)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 425, in _run_visitor
>     element.accept_schema_visitor(visitorcallable(self, conn.proxy,  
> connection=conn, **kwargs))
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/schema.py", line 228, in accept_schema_visitor
>     return visitor.visit_table(self)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/ansisql.py", line 634, in visit_table
>     self.execute()
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 687, in execute
>     return self.proxy(self.buffer.getvalue(), None)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 356, in proxy
>     return self._execute_raw(statement, parameters)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 321, in _execute_raw
>     self._execute(cursor, statement, parameters, context=context)
>   File "/Users/dmiller/Code/PyOE/resources/lib/SQLAlchemy/lib/ 
> sqlalchemy/engine/base.py", line 340, in _execute
>     raise exceptions.SQLError(statement, parameters, e)
> SQLError: (ProgrammingError) relation "engine_multi_multi_id_seq"  
> does not exist
> "\nCREATE TABLE engine_multi (\n\tmulti_id INTEGER DEFAULT nextval 
> ('engine_multi_multi_id_seq'::regclass) NOT NULL, \n\tmulti_rev  
> INTEGER DEFAULT nextval('engine_multi_multi_rev_seq'::regclass) NOT  
> NULL, \n\tname VARCHAR(50) NOT NULL, \n\tval VARCHAR(100), \n 
> \tPRIMARY KEY (multi_id, multi_rev)\n)\n\n" {}
>
>
>
>>
>> also, with sqlsoup, i had a stub module in test/ext/ to handle it  
>> but Jonathan removed it in place of a straight doctest invocation  
>> in test/ext/alltests.py.  so some "sqlite" conditional logic  
>> should be added to test/ext/alltests.py as well.
>>
>> I see one test, orm.lazytest.LazyTest1, which seems to be  
>> legitimately failing; that test passes with postgres on my end.
>
> Right, I had made a local modification to that file. So I guess it  
> was not really a clean checkout. Sorry for the confusion.
>
> ~ Daniel
>
> <testupdate.patch>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to