That's definitely my case here: my testsuite drops/creates the schema
between every test, and I had a test failing when it was the second
test that was run.

I'll submit this to the sqlite guys, and try upgrading my sqlite
module in the mean time. (I'm running the one that comes with Python
2.5.1.)

~jon



On Feb 15, 9:57 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> no idea.  below is a revised version, where the main revision is that  
> theres no SQLAlchemy ;).  So I think you should submit this to the bug  
> tracker onwww.sqlite.org.
>
> Actually this is sorta interesting since it would impact our own unit  
> tests regarding sqlite as well (which is why we run them with mysql  
> and postgres as part of our build as well).
>
> import sqlite3
>
> def test(createdrop=True):
>      conn = sqlite3.connect(':memory:')
>      cursor = conn.cursor()
>      cursor.execute("CREATE TABLE users(id INTEGER PRIMARY KEY, host  
> VARCHAR(16) NOT NULL, name VARCHAR(16) NOT NULL)")
>      cursor.execute("INSERT INTO users (host, name) VALUES (?, ?)",  
> ["localhost", "monty"])
>      cursor.close()
>
>      cursor = conn.cursor()
>      if createdrop:
>          cursor.execute("DROP TABLE users")
>          cursor.execute("CREATE TABLE users(id INTEGER PRIMARY KEY,  
> host VARCHAR(16) NOT NULL, name VARCHAR(16) NOT NULL)")
>
>      try:
>          cursor.execute("INSERT INTO users (host, name) VALUES  
> (?, ?)", [None, "python"])
>          assert False, repr(cursor.execute("select * from  
> users").fetchall())
>      except sqlite3.IntegrityError:
>          assert True
>
> test(True)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to