Closed c0state closed 3 years ago
@jeancochrane thoughts?
Great catch here @c0state, are you able to share a quick test that we might be able to use to verify this change does what we expect?
One of my tests in a private repo fails. This PR definitely fixes it, but I'm unsure why at the moment TBH.
I think https://github.com/jeancochrane/pytest-flask-sqlalchemy/issues/25 also is similar. The comment about the flask test client causing this matches my experience. It seems removing the add call would work too--unsure where it's used or why it's needed though.
I'm getting this exception https://github.com/sqlalchemy/sqlalchemy/blob/rel_1_3_19/lib/sqlalchemy/orm/session.py#L2343 in some of my tests where a record is accessed and then deleted. Per the upstream recommendation, this captures that exception and tries calling
make_transient
instead.All other errors are (re-)thrown