[sqlalchemy] Re: Testing and deprecation of nested transactions

2021-08-02 Thread Dejan Čabrilo
Hi, >From what I see, that's only pertinent to the ORM, right? I don't use ORM, SqlAlchemy core only, so I think that wouldn't work, right? Thanks! Dejan On Saturday, July 31, 2021 at 7:41:49 AM UTC+2 cfede...@gmail.com wrote: > Hi, > > Have you tried using this pattern from the

[sqlalchemy] Re: Testing and deprecation of nested transactions

2021-08-02 Thread Dejan Čabrilo
Thanks for the suggestion! Sqlite3 won't work for my use-case because I depend on Postgresql and its extensions a lot. I ended up using this fixture: @pytest.fixture(scope='function') alembic.config.main(argv=["upgrade", "head"]) yield alembic.config.main(argv=["downgrade",

[sqlalchemy] Testing and deprecation of nested transactions

2021-07-30 Thread Dejan Čabrilo
Hello everyone, I am working on a new project using SqlAlchemy Core 1.4 with Postgresql and wanted to implement the following pattern for my tests: - Before each test I would start a transaction (in a @pytest.fixture(autorun=True)) - Each test may create its own transactions - At the end of