Beautiful. Skipping the psycopg2 initialization prevents that rollback and
allows SQLAlchemy to use the same transaction.
FWIW, I don't think pool_reset_on_return=None is needed, at least for my
purposes.
Thanks for the help and thanks for the advice about raw_connection(). I'll
get that
On Tuesday, August 28, 2018 at 2:51:47 PM UTC-4, Mike Bayer wrote:
>
> On Tue, Aug 28, 2018 at 11:32 AM, 'Brian DeRocher' via sqlalchemy
> > wrote:
> > Hey all,
> >
> > I'm writing some automated tests for some legacy python code using a
> > psycopg2
Hey all,
I'm writing some automated tests for some legacy python code using a
psycopg2 connection. I'd like to check data in the database by using
SQLAlchemy. I rollback the database transaction after each test in
tearDown().
The problem is my SQLAlchemy connection doesn't see the database
? Is there anyway someone
can create the tests, so I know I got this working correctly? Also, since
sqlite doesn't support sequences, how do I get automated testing to use PG.
A pull request is coming soon.
Thanks,
Brian
--
Brian DeRocher
Noblis | noblis.org | ☎ 703.610.1589 | ✉ brian.deroc