Hi Yegor. Good question.
To be honest I do carry a lot of code between pyramid projects. I think that you are right and this is useless. I think that with this setup I have a problem with pyramid_tm and webtest. And pyramid_tm abort existing transaction. I don't remember having this problem with older version. I didn't investigate much and I pass a value to not add pyramid_tm during the test but it's a bit annoying. On Thu, Jan 7, 2016 at 6:19 AM, Yegor Roganov <[email protected]> wrote: > Cool! > I've been trying to setup pytest with sqlalchemy and pyramid myself, and > your approach looks promising. One question though: > @pytest.fixturedef db_session(request, db): """Function-scoped > sqlalchemy database session""" from transaction import abort trans = > db.connection().begin() request.addfinalizer(trans.rollback) request > .addfinalizer(abort) return dbEnter code here... > why is the `trans.rollback` call necessary? Doesn't `abort` calls this > anyway? > > > > > On Wednesday, January 6, 2016 at 12:16:54 AM UTC+2, Rach Belaid wrote: >> >> Hi, >> >> I needed this for another project so I made it standalone and of course >> this is written in pyramid :) >> >> https://github.com/rach/suma >> >> It can be used as a simple url shortener but also to extract preview data. >> >> >> R. >> >> -- >> Rach Belaid >> >> -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/d/optout. > -- Rach Belaid -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.
