Re: [sqlalchemy] Testing against DB Connector IntegrityError?

2018-03-07 Thread KCY
Examining the stacktrace more closely revealed that I made the mistake of checking for the error on the add but left the context of that error check before committing. I actually did it the correct way in my all my other tests so I'm not sure why I made the mistake at the very end. My

Re: [sqlalchemy] Testing against DB Connector IntegrityError?

2018-03-07 Thread Mike Bayer
On Wed, Mar 7, 2018 at 11:30 AM, KCY wrote: > In one of my tests I'm checking that a pair of (non primary) fields must be > unique. This definition is done with: > > __table_args__ = (UniqueConstraint('entity_id', 'version', > name='id_version_combined_unique'),) > > where

[sqlalchemy] Testing against DB Connector IntegrityError?

2018-03-07 Thread KCY
In one of my tests I'm checking that a pair of (non primary) fields must be unique. This definition is done with: __table_args__ = (UniqueConstraint('entity_id', 'version', name= 'id_version_combined_unique'),) where `entity_id` is an INT column referring to a foreign id and version is a