zopefoundation / zope.sqlalchemy

Integration of SQLAlchemy with transaction management
Other
32 stars 34 forks source link

Restore possibility to change keep_session param. #40

Closed icemac closed 4 years ago

icemac commented 5 years ago

Before version 1.2 it was possible to change the value of keep_session for certain tests. We used keep_session=True to ease unittests which are not forced to re-fetch objects from database after a commit. On the other hand selenium tests should behave more like an actual web server which does not keep the session. So we switched to keep_session=False for some tests with code like this: https://github.com/gocept/risclog.sqlalchemy/blob/44fe2494337b41e0bc3d5602ebbd7493918d841d/src/risclog/sqlalchemy/fixtures.py#L6

This is no longer possible since zope.sqlalchemy 1.2. With this commit the ability to access the ZopeTransactionEvents instance is restored.

icemac commented 5 years ago

Could this be a possible solution where I should invest to fix the tests or does anyone think this is a bad idea.